drm/imx: imx-ldb: detach panel on unbind
authorLucas Stach <l.stach@pengutronix.de>
Thu, 16 Jun 2016 09:19:41 +0000 (11:19 +0200)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 29 Aug 2016 14:30:48 +0000 (16:30 +0200)
Make sure to leave a clean panel state behind and allow to
properly attach to the panel again on a rebind.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/drm/imx/imx-ldb.c

index 87b83bd..27a471c 100644 (file)
@@ -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);
+
                kfree(channel->edid);
                i2c_put_adapter(channel->ddc);
        }