Skip to contentSkip to conversation

of: platform: Use default match table for /firmware

PATCH In review Rob Herring (Arm) 2 participants 3 messages Jan 14 – Jan 17 Device tree

lore
Share & tools
lore

Rob Herring (Arm)

author maintainer
#0 lore raw

PATCH 1/1 of: platform: Use default match table for /firmware

Calling of_platform_populate() without a match table will only populate the immediate child nodes under /firmware. This is usually fine, but in the case of something like a "simple-mfd" node such as "raspberrypi,bcm2835-firmware", those child nodes will not be populated. And subsequent calls won't work either because the /firmware node is marked as processed already.

Switch the call to of_platform_default_populate() to solve this problem. It should be a nop for existing cases.

Fixes 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()")
---
 drivers/of/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/platform.c +1 -1
index d4e169b3b5af..d90b1677d84e 100644
@@ -568,7 +568,7 @@ static int __init of_platform_default_populate_init(void)
 
 		node = of_find_node_by_path("/firmware");
 		if (node) {
-			of_platform_populate(node, NULL, NULL, NULL);
+			of_platform_default_populate(node, NULL, NULL);
 			of_node_put(node);
 		}
 
Signature · 1 line
2.51.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Rob Herring (Arm)

Calling of_platform_populate() without a match table will only populate the immediate child nodes under /firmware. This is usually fine, but in the case of something like a "simple-mfd" node such as "raspberrypi,bcm2835-firmware", those child nodes will not be populated. And subsequent calls won't work either because the /firmware node is marked as processed already.

Switch the call to of_platform_default_populate() to solve this problem. It should be a nop for existing cases.

Thanks, had not thought of child nodes for sure at that time.

Signature · 2 lines
Regards,
Sudeep
author maintainer
#2 lore raw
In reply to Rob Herring (Arm)
Quoted 33 lines · Rob Herring (Arm)

Calling of_platform_populate() without a match table will only populate the immediate child nodes under /firmware. This is usually fine, but in the case of something like a "simple-mfd" node such as "raspberrypi,bcm2835-firmware", those child nodes will not be populated. And subsequent calls won't work either because the /firmware node is marked as processed already.

Switch the call to of_platform_default_populate() to solve this problem. It should be a nop for existing cases.

Fixes 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()")
---
 drivers/of/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/platform.c +1 -1
index d4e169b3b5af..d90b1677d84e 100644
@@ -568,7 +568,7 @@ static int __init of_platform_default_populate_init(void)
 
 		node = of_find_node_by_path("/firmware");
 		if (node) {
-			of_platform_populate(node, NULL, NULL, NULL);
+			of_platform_default_populate(node, NULL, NULL);
 			of_node_put(node);
 		}
 
Signature · 1 line
2.51.0