mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 21:51:31 +00:00
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>
This commit is contained in:
parent
51c12319b4
commit
747558d014
1 changed files with 10 additions and 5 deletions
|
@ -265,9 +265,15 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
|
||||||
for (offset = fdt_first_subnode(blob, offset);
|
for (offset = fdt_first_subnode(blob, offset);
|
||||||
offset > 0;
|
offset > 0;
|
||||||
offset = fdt_next_subnode(blob, offset)) {
|
offset = fdt_next_subnode(blob, offset)) {
|
||||||
/* "chosen" node isn't a device itself but may contain some: */
|
const char *node_name = fdt_get_name(blob, offset, NULL);
|
||||||
if (!strcmp(fdt_get_name(blob, offset, NULL), "chosen")) {
|
|
||||||
pr_debug("parsing subnodes of \"chosen\"\n");
|
/*
|
||||||
|
* 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,
|
err = dm_scan_fdt_node(parent, blob, offset,
|
||||||
pre_reloc_only);
|
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);
|
err = lists_bind_fdt(parent, offset_to_ofnode(offset), NULL);
|
||||||
if (err && !ret) {
|
if (err && !ret) {
|
||||||
ret = err;
|
ret = err;
|
||||||
debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL),
|
debug("%s: ret=%d\n", node_name, ret);
|
||||||
ret);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue