public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] Revert "dm: fdt: scan for devices under /firmware too"
@ 2020-02-17 20:35 Thirupathaiah Annapureddy
  2020-02-18  7:22 ` Michal Simek
  0 siblings, 1 reply; 2+ messages in thread
From: Thirupathaiah Annapureddy @ 2020-02-17 20:35 UTC (permalink / raw)
  To: u-boot

Subnodes under "/firmware" node are scanned twice in
dm_scan_fdt_node() and dm_extended_scan_fdt().
This patch removes the scanning in dm_scan_fdt_node() to
avoid double scanning.

This reverts commit 747558d014577526bf2e8d9fe9ca748fdbf75d8a.

Signed-off-by: Thirupathaiah Annapureddy <thiruan@linux.microsoft.com>
---
 drivers/core/root.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/core/root.c b/drivers/core/root.c
index e85643819e..cb695e933a 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -254,15 +254,9 @@ 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)) {
-		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);
+		/* "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");
 
 			err = dm_scan_fdt_node(parent, blob, offset,
 					       pre_reloc_only);
@@ -279,7 +273,8 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
 				     pre_reloc_only);
 		if (err && !ret) {
 			ret = err;
-			debug("%s: ret=%d\n", node_name, ret);
+			debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL),
+			      ret);
 		}
 	}
 
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-18  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-17 20:35 [PATCH] Revert "dm: fdt: scan for devices under /firmware too" Thirupathaiah Annapureddy
2020-02-18  7:22 ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox