[PATCH 2/2] OF: Fix fixups to fix Linux DT instead of Barebox DT

Trent Piepho tpiepho at kymetacorp.com
Mon Jan 4 11:02:34 PST 2016


OF fixups cm_cogent_fixup() and hb_fixup() are supposed to modify the
Linux device tree.  And they did originally, but commit
e520a8cc463760d21890b35218e4dac817e7c7e7 changed them to use
for_each_compatible_node(), which iterates through the Barebox DT.
Use new for_each_compatible_node_from() to specify the Linux DT root
as the start point.

Signed-off-by: Trent Piepho <tpiepho at kymetacorp.com>
---
 arch/arm/boards/at91sam9x5ek/hw_version.c | 2 +-
 arch/arm/boards/highbank/init.c           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/at91sam9x5ek/hw_version.c b/arch/arm/boards/at91sam9x5ek/hw_version.c
index 37eb1f8..2f84d82 100644
--- a/arch/arm/boards/at91sam9x5ek/hw_version.c
+++ b/arch/arm/boards/at91sam9x5ek/hw_version.c
@@ -235,7 +235,7 @@ static int cm_cogent_fixup(struct device_node *root, void *unused)
 	int ret;
 	struct device_node *node;
 
-	for_each_compatible_node(node, NULL, "atmel,hsmci") {
+	for_each_compatible_node_from(node, root, NULL, "atmel,hsmci") {
 		struct device_node *slotnode =
 			of_get_child_by_name(node, "slot");
 		if (!slotnode)
diff --git a/arch/arm/boards/highbank/init.c b/arch/arm/boards/highbank/init.c
index a0d4b30..1cb02e6 100644
--- a/arch/arm/boards/highbank/init.c
+++ b/arch/arm/boards/highbank/init.c
@@ -35,13 +35,13 @@ static int hb_fixup(struct device_node *root, void *unused)
 	__be32 latency;
 
 	if (!(reg & HB_PWRDOM_STAT_SATA)) {
-		for_each_compatible_node(node, NULL, "calxeda,hb-ahci")
+		for_each_compatible_node_from(node, root, NULL, "calxeda,hb-ahci")
 			of_set_property(node, "status", "disabled",
 					sizeof("disabled"), 1);
 	}
 
 	if (!(reg & HB_PWRDOM_STAT_EMMC)) {
-		for_each_compatible_node(node, NULL, "calxeda,hb-sdhci")
+		for_each_compatible_node_from(node, root, NULL, "calxeda,hb-sdhci")
 			of_set_property(node, "status", "disabled",
 					sizeof("disabled"), 1);
 	}
-- 
1.8.3.1




More information about the barebox mailing list