mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-23 05:08:24 +00:00
dm: core: Simplify dm_probe_devices()
There is no point in checking the pre_reloc flag, since devices not marked as pre-reloc will not have been bound, so won't exist yet. There doesn't seem to be any point in checking if the device has a valid devicetree node either, so drop that too. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
70c79dc88f
commit
21dd873572
1 changed files with 5 additions and 11 deletions
|
@ -288,26 +288,20 @@ void *dm_priv_to_rw(void *priv)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int dm_probe_devices(struct udevice *dev, bool pre_reloc_only)
|
static int dm_probe_devices(struct udevice *dev)
|
||||||
{
|
{
|
||||||
ofnode node = dev_ofnode(dev);
|
|
||||||
struct udevice *child;
|
struct udevice *child;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (pre_reloc_only &&
|
|
||||||
(!ofnode_valid(node) || !ofnode_pre_reloc(node)) &&
|
|
||||||
!(dev->driver->flags & DM_FLAG_PRE_RELOC))
|
|
||||||
goto probe_children;
|
|
||||||
|
|
||||||
if (dev_get_flags(dev) & DM_FLAG_PROBE_AFTER_BIND) {
|
if (dev_get_flags(dev) & DM_FLAG_PROBE_AFTER_BIND) {
|
||||||
|
int ret;
|
||||||
|
|
||||||
ret = device_probe(dev);
|
ret = device_probe(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
probe_children:
|
|
||||||
list_for_each_entry(child, &dev->child_head, sibling_node)
|
list_for_each_entry(child, &dev->child_head, sibling_node)
|
||||||
dm_probe_devices(child, pre_reloc_only);
|
dm_probe_devices(child);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -344,7 +338,7 @@ static int dm_scan(bool pre_reloc_only)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
return dm_probe_devices(gd->dm_root, pre_reloc_only);
|
return dm_probe_devices(gd->dm_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dm_init_and_scan(bool pre_reloc_only)
|
int dm_init_and_scan(bool pre_reloc_only)
|
||||||
|
|
Loading…
Add table
Reference in a new issue