From f9387eda601facb2f4f9a8fc76b86beeb3b94683 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 17 Sep 2019 09:29:22 +0000 Subject: [PATCH] core: device: use dev_power_domain_on When multiple power domains attached to a device, need power on them all, so use dev_power_domain_on to do that. Change-Id: I787048368bd438825f330821cdd84124e8090228 Signed-off-by: Peng Fan --- drivers/core/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/core/device.c b/drivers/core/device.c index 228f99e..9dfd408 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -307,7 +307,6 @@ static void *alloc_priv(int size, uint flags) int device_ofdata_to_platdata(struct udevice *dev) { - struct power_domain pd; const struct driver *drv; int size = 0; int ret; @@ -427,8 +426,9 @@ int device_probe(struct udevice *dev) if (CONFIG_IS_ENABLED(POWER_DOMAIN) && dev->parent && device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) { - if (!power_domain_get(dev, &pd)) - power_domain_on(&pd); + ret = dev_power_domain_on(dev); + if (ret) + goto fail; } ret = uclass_pre_probe_device(dev); -- 2.7.4