From: Peng Fan Date: Fri, 27 Sep 2019 01:55:50 +0000 Subject: [U-Boot] [PATCH V3 2/2] core: device: use dev_power_domain_on In-Reply-To: <20190927021230.4175-1-peng.fan@nxp.com> References: <20190927021230.4175-1-peng.fan@nxp.com> Message-ID: <20190927021230.4175-2-peng.fan@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de When multiple power domains attached to a device, need power on them all, so use dev_power_domain_on to do that. Signed-off-by: Peng Fan Reviewed-by: Simon Glass --- V3: Add R-b tag V2: Use dev_power_domain_on 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 05dadf98f9..f4d7140698 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_probe(struct udevice *dev) { - struct power_domain pd; const struct driver *drv; int size = 0; int ret; @@ -390,8 +389,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.16.4