[PATCH] OF: base: initalize from node in of_find_node_with_property

Sebastian Hesselbarth sebastian.hesselbarth at gmail.com
Fri Jul 5 17:19:43 EDT 2013


This adds initialization of from device node with root_node if NULL
is passed. This corresponds to the behavior of all other node iterators.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth at gmail.com>
---
@Sascha: this is the last remaining iterator fix we talked about.

Cc: Sascha Hauer <s.hauer at pengutronix.de>
Cc: barebox at lists.infradead.org
---
 drivers/of/base.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 5440f40..7bee912 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -364,6 +364,9 @@ struct device_node *of_find_node_with_property(struct device_node *from,
 {
 	struct device_node *np;
 
+	if (!from)
+		from = root_node;
+
 	of_tree_for_each_node_from(np, from) {
 		struct property *pp = of_find_property(np, prop_name, NULL);
 		if (pp)
-- 
1.7.10.4




More information about the barebox mailing list