Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aabc08dc662b7acb17ca5706533253ce10c050b1
Commit:     aabc08dc662b7acb17ca5706533253ce10c050b1
Parent:     18cce5d321cf01413f416d7fe9fb00404cba04fd
Author:     Michael Ellerman <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 26 19:03:45 2007 +1100
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Tue Dec 11 13:34:39 2007 +1100

    [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: Michael Ellerman <[EMAIL PROTECTED]>
    Acked-by: Stephen Rothwell <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 include/linux/of.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/linux/of.h b/include/linux/of.h
index 5c39b92..c65af7b 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to