9
0
Fork 0

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>
This commit is contained in:
Uwe Kleine-König 2017-01-16 09:04:57 +01:00 committed by Sascha Hauer
parent e1e8656a7d
commit 08dd5af735
1 changed files with 4 additions and 2 deletions

View File

@ -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))