diff mbox

drm/imx: imx-ldb: detach existing panels when unbinding the driver

Message ID 1470996365-4799-1-git-send-email-gnuiyl@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ying Liu Aug. 12, 2016, 10:06 a.m. UTC
We should detach existing panels when unbinding the driver since
they are attached at the binding stage, otherwise, the attaching
function would return the -EBUSY value when the ldb driver module
is installed again.

Signed-off-by: Liu Ying <gnuiyl@gmail.com>
---
 drivers/gpu/drm/imx/imx-ldb.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index 4eed3a6..a22c6f7 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -757,6 +757,9 @@  static void imx_ldb_unbind(struct device *dev, struct device *master,
 	for (i = 0; i < 2; i++) {
 		struct imx_ldb_channel *channel = &imx_ldb->channel[i];
 
+		if (channel->panel)
+			drm_panel_detach(channel->panel);
+
 		if (!channel->connector.funcs)
 			continue;