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
parent
f1e48a3e58
commit
baddd42022
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue