Commit aabc08dc authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[POWERPC] Add for_each_child_of_node() helper for iterating over child nodes

Add for_each_child_of_node() to encapsulate the common idiom of
iterating over the children of a device_node.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Acked-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 18cce5d3
...@@ -46,6 +46,10 @@ extern struct device_node *of_find_node_by_phandle(phandle handle); ...@@ -46,6 +46,10 @@ extern struct device_node *of_find_node_by_phandle(phandle handle);
extern struct device_node *of_get_parent(const struct device_node *node); extern struct device_node *of_get_parent(const struct device_node *node);
extern struct device_node *of_get_next_child(const struct device_node *node, extern struct device_node *of_get_next_child(const struct device_node *node,
struct device_node *prev); struct device_node *prev);
#define for_each_child_of_node(parent, child) \
for (child = of_get_next_child(parent, NULL); child != NULL; \
child = of_get_next_child(parent, child))
extern struct property *of_find_property(const struct device_node *np, extern struct property *of_find_property(const struct device_node *np,
const char *name, const char *name,
int *lenp); int *lenp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment