summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2019-02-18 23:48:02 -0800
committerYe Li <ye.li@nxp.com>2019-02-18 23:51:00 -0800
commit8524ca764d8fbd05da1593abfed62bb075c50cd4 (patch)
treefd9e16c854ab40b27a11733e5a7b364ed6134150 /drivers
parentb62b82ad595a744f07306db4b88d644ae024872a (diff)
MLK-20945-2 dm: device: Check the power up result in probe
If a device has relevant power domain, we will check the power up result in probing the device. If the power up is failed, the device_probe will return failure immediately. The only exception is the new FLAG (DM_FLAG_IGNORE_POWER_ON) is set by driver to indicate ignore the power up result. Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/device.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index 303289bbe4e..dec99e77f2b 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -383,7 +383,13 @@ int device_probe(struct udevice *dev)
if (dev->parent && device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) {
struct power_domain pd;
if (!power_domain_get(dev, &pd)) {
- power_domain_on(&pd);
+ if (!(dev->driver->flags & DM_FLAG_IGNORE_POWER_ON)) {
+ ret = power_domain_on(&pd);
+ if (ret) {
+ power_domain_free(&pd);
+ goto fail;
+ }
+ }
}
}
#endif