summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2014-01-02 14:49:52 +0530
committerTomi Valkeinen <tomi.valkeinen@ti.com>2014-01-09 15:17:25 +0200
commitcc823bdcfb468808467a9f23186a10404f573fc4 (patch)
tree80b9227aacc592b5f1c540488099c90056ffc48a /drivers/gpu/drm/omapdrm
parent3a01ab255637fdc2fbc97cf356f1b971c3fc0c64 (diff)
downloadblackbird-op-linux-cc823bdcfb468808467a9f23186a10404f573fc4.tar.gz
blackbird-op-linux-cc823bdcfb468808467a9f23186a10404f573fc4.zip
drm/omap: fix: disconnect devices when omapdrm module is removed
At omapdrm probe, we install manager ops and connect omapdss devices. This needs to be undone when omapdrm module is removed so that omapdss is in a clean state. This ensures that we can re-insert omapdrm module, or some other module which uses omapdss(like omapfb/omap_vout). Currently, omapdrm's remove neither uninstalls manager ops, or disconnects omapdss devices. We make sure that this is done in pdev_remove. omapdrm establishes connections for omap_dss_device devices when probed. It should also be responsible to disconnect the devices. Keeping the devices connected can prevent the panel driver modules from unloading, it also causes issues when we try to remove or re-insert omapdrm module. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 651f9022308f..fca5667d3bf5 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -86,6 +86,13 @@ static bool channel_used(struct drm_device *dev, enum omap_channel channel)
return false;
}
+static void omap_disconnect_dssdevs(void)
+{
+ struct omap_dss_device *dssdev = NULL;
+
+ for_each_dss_dev(dssdev)
+ dssdev->driver->disconnect(dssdev);
+}
static int omap_connect_dssdevs(void)
{
@@ -116,10 +123,7 @@ cleanup:
* if we are deferring probe, we disconnect the devices we previously
* connected
*/
- dssdev = NULL;
-
- for_each_dss_dev(dssdev)
- dssdev->driver->disconnect(dssdev);
+ omap_disconnect_dssdevs();
return r;
}
@@ -693,6 +697,9 @@ static int pdev_remove(struct platform_device *device)
DBG("");
drm_platform_exit(&omap_drm_driver, device);
+ omap_disconnect_dssdevs();
+ omap_crtc_pre_uninit();
+
platform_driver_unregister(&omap_dmm_driver);
return 0;
}
OpenPOWER on IntegriCloud