summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Ying <victor.liu@nxp.com>2017-11-14 13:28:41 +0800
committerLiu Ying <victor.liu@nxp.com>2017-11-15 10:08:50 +0800
commitb7c33a0e4021fda663241eccdbd445fd5a455ace (patch)
tree75bfb219104b84333c8655d4b81b34a9cfb94767
parentea30b5c6631379cd054f949480e0c897e445c1b0 (diff)
MLK-16812 drm/imx: ldb: Let system PM behave properly when we are unbinded
The system power management operations should get correct driver data before going on to further handling. When the component is unbinded, driver data should be set to NULL so that the system power management may be bypassed(return early). This way, we may prevent the system power management from using any invalid driver data. Fixes: 915ac0ad7369 ("MLK-16581-7 drm/imx: ldb: Add system power management support") Signed-off-by: Liu Ying <victor.liu@nxp.com> (cherry picked from commit c7aeac017eeffe97df2506314d7647e2364185d1)
-rw-r--r--drivers/gpu/drm/imx/imx-ldb.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/imx/imx-ldb.c b/drivers/gpu/drm/imx/imx-ldb.c
index bbe111e7d00f..cfb3f02f1a68 100644
--- a/drivers/gpu/drm/imx/imx-ldb.c
+++ b/drivers/gpu/drm/imx/imx-ldb.c
@@ -1291,6 +1291,8 @@ static void imx_ldb_unbind(struct device *dev, struct device *master,
kfree(channel->edid);
i2c_put_adapter(channel->ddc);
}
+
+ dev_set_drvdata(dev, NULL);
}
static const struct component_ops imx_ldb_ops = {
@@ -1316,6 +1318,9 @@ static int imx_ldb_suspend(struct device *dev)
struct imx_ldb_channel *channel;
int i;
+ if (imx_ldb == NULL)
+ return 0;
+
for (i = 0; i < 2; i++) {
channel = &imx_ldb->channel[i];
@@ -1333,6 +1338,9 @@ static int imx_ldb_resume(struct device *dev)
struct imx_ldb *imx_ldb = dev_get_drvdata(dev);
int i;
+ if (imx_ldb == NULL)
+ return 0;
+
if (imx_ldb->visible_phy)
for (i = 0; i < 2; i++)
phy_init(imx_ldb->channel[i].phy);