mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
nvmap: Register nvmap device towards end of probe
On TOT, in nvmap probe function, platform_set_drvdata is called after misc register. So nvmap node is created and clients can open it even before platform driver data is set. Because of which, the call to dev_get_drvdata returns NULL and BUG_ON condition is hit. Move misc register call towards end of the nvmap probe, so that /dev/nvmap is exposed once all initilization is completed. As misc register being moved to end of probe, the functions which are called before misc register and which make use of dev_user field from nvmap_device for calling dev_err/dev_info function will see the dev field as NULL. Hence replace such calls with pr_err/pr_info. Bug 3853486 Change-Id: Ifdd8443812a621aceada7739cf9b02fcf00568b4 Signed-off-by: Ketan Patil <ketanp@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2803672 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
Laxman Dewangan
parent
92f34279ba
commit
596156cc4b
@@ -1425,13 +1425,6 @@ int __init nvmap_probe(struct platform_device *pdev)
|
||||
mutex_init(&dev->tags_lock);
|
||||
mutex_init(&dev->carveout_lock);
|
||||
|
||||
e = misc_register(&dev->dev_user);
|
||||
if (e) {
|
||||
dev_err(&pdev->dev, "unable to register miscdevice %s\n",
|
||||
dev->dev_user.name);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
nvmap_debug_root = debugfs_create_dir("nvmap", NULL);
|
||||
nvmap_dev->debug_root = nvmap_debug_root;
|
||||
if (IS_ERR_OR_NULL(nvmap_debug_root))
|
||||
@@ -1503,11 +1496,15 @@ int __init nvmap_probe(struct platform_device *pdev)
|
||||
}
|
||||
#endif /* CVNAS_BUILTIN */
|
||||
|
||||
e = misc_register(&dev->dev_user);
|
||||
if (e) {
|
||||
dev_err(&pdev->dev, "unable to register miscdevice %s\n",
|
||||
dev->dev_user.name);
|
||||
goto fail_sci_ipc;
|
||||
}
|
||||
goto finish;
|
||||
#ifdef CVNAS_BUILTIN
|
||||
fail_sci_ipc:
|
||||
nvmap_sci_ipc_exit();
|
||||
#endif /* CVNAS_BUILTIN */
|
||||
fail_heaps:
|
||||
debugfs_remove_recursive(nvmap_dev->debug_root);
|
||||
for (i = 0; i < dev->nr_carveouts; i++) {
|
||||
|
||||
Reference in New Issue
Block a user