Skip to content

Commit

Permalink
[POWERPC] Add for_each_child_of_node() helper for iterating over chil…
Browse files Browse the repository at this point in the history
…d nodes

Add for_each_child_of_node() to encapsulate the common idiom of
iterating over the children of a device_node.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Michael Ellerman authored and Paul Mackerras committed Dec 11, 2007
1 parent 18cce5d commit aabc08d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/linux/of.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_next_child(const struct device_node *node,
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,
const char *name,
int *lenp);
Expand Down

0 comments on commit aabc08d

Please sign in to comment.