1
0
Fork 0

regulator: pf1550-regulator-rpmsg: check rpmsg channel is ready

Return EPROBE_DEFER if rpmsg channel is not ready.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Robin Gong 2019-08-16 23:43:07 +08:00 committed by Dong Aisheng
parent f1e48a3e58
commit baddd42022
1 changed files with 6 additions and 0 deletions

View File

@ -70,6 +70,7 @@ enum pf1550_status {
struct pf1550_regulator_info {
struct rpmsg_device *rpdev;
bool is_ready;
struct device *dev;
struct pf1550_regulator_rpmsg *msg;
struct completion cmd_complete;
@ -333,6 +334,8 @@ static int rpmsg_regulator_probe(struct rpmsg_device *rpdev)
init_completion(&pf1550_info.cmd_complete);
mutex_init(&pf1550_info.lock);
pf1550_info.is_ready = true;
dev_info(&rpdev->dev, "new channel: 0x%x -> 0x%x!\n",
rpdev->src, rpdev->dst);
return 0;
@ -450,6 +453,9 @@ static int pf1550_regulator_probe(struct platform_device *pdev)
if (!np)
return -ENODEV;
if (!pf1550_info.is_ready)
return -EPROBE_DEFER;
config.dev = &pdev->dev;
config.driver_data = &pf1550_info;
pf1550_info.dev = &pdev->dev;