[PATCHv3 1/5] of: base: Add for_each_node_by_name_from
Teresa Gámez
t.gamez at phytec.de
Tue Sep 30 04:15:26 PDT 2014
Added for_each_node_by_name_from() to be able to
pass external root node.
Signed-off-by: Teresa Gámez <t.gamez at phytec.de>
---
include/of.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/of.h b/include/of.h
index e6993fd..cd2bfe0 100644
--- a/include/of.h
+++ b/include/of.h
@@ -568,6 +568,9 @@ static inline struct device_d *of_find_device_by_node(struct device_node *np)
#define for_each_node_by_name(dn, name) \
for (dn = of_find_node_by_name(NULL, name); dn; \
dn = of_find_node_by_name(dn, name))
+#define for_each_node_by_name_from(dn, root, name) \
+ for (dn = of_find_node_by_name(root, name); dn; \
+ dn = of_find_node_by_name(dn, name))
#define for_each_compatible_node(dn, type, compatible) \
for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
dn = of_find_compatible_node(dn, type, compatible))
--
1.9.1
More information about the barebox
mailing list