summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2017-01-16 09:04:57 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-01-17 07:56:27 +0100
commit08dd5af735c05fa799f59fca1613362d4c7935f0 (patch)
treead303a9479899d67f5e8b989edb19be58827e9a4
parente1e8656a7d24133758dc65512a5714c9d0bf1abd (diff)
downloadbarebox-08dd5af735c05fa799f59fca1613362d4c7935f0.tar.gz
barebox-08dd5af735c05fa799f59fca1613362d4c7935f0.tar.xz
of: provide for_each_matching_node_from
This is for_each_matching_node for a given root similar to the other ..._from functions. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--include/of.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/of.h b/include/of.h
index ed6e870473..e3bb452b86 100644
--- a/include/of.h
+++ b/include/of.h
@@ -665,9 +665,11 @@ static inline struct device_node *of_find_matching_node(
{
return of_find_matching_node_and_match(from, matches, NULL);
}
-#define for_each_matching_node(dn, matches) \
- for (dn = of_find_matching_node(NULL, matches); dn; \
+#define for_each_matching_node_from(dn, root, matches) \
+ for (dn = of_find_matching_node(root, matches); dn; \
dn = of_find_matching_node(dn, matches))
+#define for_each_matching_node(dn, matches) \
+ for_each_matching_node_from(dn, NULL, matches)
#define for_each_matching_node_and_match(dn, matches, match) \
for (dn = of_find_matching_node_and_match(NULL, matches, match); \
dn; dn = of_find_matching_node_and_match(dn, matches, match))