Skip to content
Snippets Groups Projects
Commit 6c515401 authored by Liu Ying's avatar Liu Ying Committed by Leonard Crestez
Browse files

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: default avatarLiu Ying <victor.liu@nxp.com>
(cherry picked from commit 91033d87)
parent 62a8ea5d
No related branches found
No related tags found
No related merge requests found
...@@ -1281,6 +1281,8 @@ static void imx_ldb_unbind(struct device *dev, struct device *master, ...@@ -1281,6 +1281,8 @@ static void imx_ldb_unbind(struct device *dev, struct device *master,
kfree(channel->edid); kfree(channel->edid);
i2c_put_adapter(channel->ddc); i2c_put_adapter(channel->ddc);
} }
dev_set_drvdata(dev, NULL);
} }
static const struct component_ops imx_ldb_ops = { static const struct component_ops imx_ldb_ops = {
...@@ -1306,6 +1308,9 @@ static int imx_ldb_suspend(struct device *dev) ...@@ -1306,6 +1308,9 @@ static int imx_ldb_suspend(struct device *dev)
struct imx_ldb_channel *channel; struct imx_ldb_channel *channel;
int i; int i;
if (imx_ldb == NULL)
return 0;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
channel = &imx_ldb->channel[i]; channel = &imx_ldb->channel[i];
...@@ -1323,6 +1328,9 @@ static int imx_ldb_resume(struct device *dev) ...@@ -1323,6 +1328,9 @@ static int imx_ldb_resume(struct device *dev)
struct imx_ldb *imx_ldb = dev_get_drvdata(dev); struct imx_ldb *imx_ldb = dev_get_drvdata(dev);
int i; int i;
if (imx_ldb == NULL)
return 0;
if (imx_ldb->visible_phy) if (imx_ldb->visible_phy)
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
phy_init(imx_ldb->channel[i].phy); phy_init(imx_ldb->channel[i].phy);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment