summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-03-28 23:03:48 +0300
committerSimon Glass <sjg@chromium.org>2020-04-16 17:07:58 +0300
commitced1080489077ab9943c319a38c2d89adb215f1f (patch)
treecbeb12fd9bf49b10cb2cfc9034c81e045ae14160 /drivers/core
parent8474da946f58a127b2006c526ae6f9b5a968d422 (diff)
downloadu-boot-ced1080489077ab9943c319a38c2d89adb215f1f.tar.xz
dm: core: Add a way to skip powering down power domains
When removing a device the power domains it uses are generally powered off. But when we are trying to unbind all devices (e.g. for running tests) we don't want to probe a device in the 'remove' path. Add a new flag to skip this power-down step. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/device-remove.c3
-rw-r--r--drivers/core/uclass.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index 8736fd9821..efdb0f2905 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -198,7 +198,8 @@ int device_remove(struct udevice *dev, uint flags)
}
}
- if (!(drv->flags &
+ if (!(flags & DM_REMOVE_NO_PD) &&
+ !(drv->flags &
(DM_FLAG_DEFAULT_PD_CTRL_OFF | DM_FLAG_REMOVE_WITH_PD_ON)) &&
dev != gd->cur_serial_dev)
dev_power_domain_off(dev);
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c
index b24b677c55..6849302936 100644
--- a/drivers/core/uclass.c
+++ b/drivers/core/uclass.c
@@ -118,7 +118,7 @@ int uclass_destroy(struct uclass *uc)
while (!list_empty(&uc->dev_head)) {
dev = list_first_entry(&uc->dev_head, struct udevice,
uclass_node);
- ret = device_remove(dev, DM_REMOVE_NORMAL);
+ ret = device_remove(dev, DM_REMOVE_NORMAL | DM_REMOVE_NO_PD);
if (ret)
return log_msg_ret("remove", ret);
ret = device_unbind(dev);