diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2018-09-25 17:40:05 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-10-07 17:47:38 +0300 |
commit | 747558d014577526bf2e8d9fe9ca748fdbf75d8a (patch) | |
tree | 3e1dc77ab5639077e68e26c33cc0322fd4eb9276 /drivers/core/root.c | |
parent | 51c12319b44a9fdb12192cb2d97efe32fce8ca49 (diff) | |
download | u-boot-747558d014577526bf2e8d9fe9ca748fdbf75d8a.tar.xz |
dm: fdt: scan for devices under /firmware too
Just as /chosen may contain devices /firmware may contain devices, scan
for devices under /firmware too.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'drivers/core/root.c')
-rw-r--r-- | drivers/core/root.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c index 47d10b888f..b54bf5bcdc 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -265,9 +265,15 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob, for (offset = fdt_first_subnode(blob, offset); offset > 0; offset = fdt_next_subnode(blob, offset)) { - /* "chosen" node isn't a device itself but may contain some: */ - if (!strcmp(fdt_get_name(blob, offset, NULL), "chosen")) { - pr_debug("parsing subnodes of \"chosen\"\n"); + const char *node_name = fdt_get_name(blob, offset, NULL); + + /* + * The "chosen" and "firmware" nodes aren't devices + * themselves but may contain some: + */ + if (!strcmp(node_name, "chosen") || + !strcmp(node_name, "firmware")) { + pr_debug("parsing subnodes of \"%s\"\n", node_name); err = dm_scan_fdt_node(parent, blob, offset, pre_reloc_only); @@ -286,8 +292,7 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob, err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL); if (err && !ret) { ret = err; - debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL), - ret); + debug("%s: ret=%d\n", node_name, ret); } } |