summaryrefslogtreecommitdiff
path: root/drivers/core/root.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-04-28 13:46:31 -0400
committerTom Rini <trini@konsulko.com>2022-04-28 13:46:31 -0400
commite95afa56753cebcd20a5114b6d121f281b789006 (patch)
tree0341804963b0b02bcd2ac0ddb1d306f804871938 /drivers/core/root.c
parent8b2b125e95c44bb007b4573945f4aedb8a56222c (diff)
parent53ee48b67302e188dc2805cef393707975b305c8 (diff)
Merge branch '2022-04-28-led-updates'
- DM GPIO bugfix - LED related code clean-ups - Fix some of the DM/LED tests - Update the LED dt binding doc
Diffstat (limited to 'drivers/core/root.c')
-rw-r--r--drivers/core/root.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c
index e09c12f4d6e..17dd1205a32 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -361,6 +361,28 @@ void *dm_priv_to_rw(void *priv)
}
#endif
+static int dm_probe_devices(struct udevice *dev, bool pre_reloc_only)
+{
+ u32 mask = DM_FLAG_PROBE_AFTER_BIND;
+ u32 flags = dev_get_flags(dev);
+ struct udevice *child;
+ int ret;
+
+ if (pre_reloc_only)
+ mask |= DM_FLAG_PRE_RELOC;
+
+ if ((flags & mask) == mask) {
+ ret = device_probe(dev);
+ if (ret)
+ return ret;
+ }
+
+ list_for_each_entry(child, &dev->child_head, sibling_node)
+ dm_probe_devices(child, pre_reloc_only);
+
+ return 0;
+}
+
/**
* dm_scan() - Scan tables to bind devices
*
@@ -393,7 +415,7 @@ static int dm_scan(bool pre_reloc_only)
if (ret)
return ret;
- return 0;
+ return dm_probe_devices(gd->dm_root, pre_reloc_only);
}
int dm_init_and_scan(bool pre_reloc_only)