aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-04-02 07:31:50 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-04-14 05:34:14 -0400
commitea7e3a662814447cd329390feddd04b9ec0a4b82 (patch)
treed277124dbb5c40d9a8fe6c15e94cbeeb56c8b297 /drivers/gpu
parent707cf58a0a847f60f849b44bfb9b85dcc17c599d (diff)
drm/omap: fix DMM driver (un)registration
At the moment the DMM driver is never unregistered, even if it's registered in the omapdrm module's init function. This means we'll get errors when reloading the omapdrm module. Fix this by unregistering the DMM driver properly, and also change the module init to fail if DMM driver cannot be registered, simplifying the unregister path as we don't need to keep the state whether we registered the DMM driver or not. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index df3e66416a30..f16a07d1668d 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -727,18 +727,33 @@ static struct platform_driver pdev = {
727 727
728static int __init omap_drm_init(void) 728static int __init omap_drm_init(void)
729{ 729{
730 int r;
731
730 DBG("init"); 732 DBG("init");
731 if (platform_driver_register(&omap_dmm_driver)) { 733
732 /* we can continue on without DMM.. so not fatal */ 734 r = platform_driver_register(&omap_dmm_driver);
733 dev_err(NULL, "DMM registration failed\n"); 735 if (r) {
736 pr_err("DMM driver registration failed\n");
737 return r;
734 } 738 }
735 return platform_driver_register(&pdev); 739
740 r = platform_driver_register(&pdev);
741 if (r) {
742 pr_err("omapdrm driver registration failed\n");
743 platform_driver_unregister(&omap_dmm_driver);
744 return r;
745 }
746
747 return 0;
736} 748}
737 749
738static void __exit omap_drm_fini(void) 750static void __exit omap_drm_fini(void)
739{ 751{
740 DBG("fini"); 752 DBG("fini");
753
741 platform_driver_unregister(&pdev); 754 platform_driver_unregister(&pdev);
755
756 platform_driver_unregister(&omap_dmm_driver);
742} 757}
743 758
744/* need late_initcall() so we load after dss_driver's are loaded */ 759/* need late_initcall() so we load after dss_driver's are loaded */