summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2014-05-07 14:38:43 (GMT)
committerMarek Szyprowski <m.szyprowski@samsung.com>2014-05-15 05:29:23 (GMT)
commit1c5b70c0687ea69d9980f0e73fd78c13994424b5 (patch)
tree9e03ea28b29e913a429f88c7ea2e512b3a398bf2
parent75fda2eb944bbbf567d2349b7bcd4bfefc118ca8 (diff)
downloadlinux-3.10-1c5b70c0687ea69d9980f0e73fd78c13994424b5.zip
linux-3.10-1c5b70c0687ea69d9980f0e73fd78c13994424b5.tar.gz
linux-3.10-1c5b70c0687ea69d9980f0e73fd78c13994424b5.tar.bz2
drivers: of: add for_each_available_child_of_node() macro
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I7713121fa18e780df480c5a5c6ebfa0972424f6f
-rw-r--r--include/linux/of.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 1fd08ca..45152b1 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -292,6 +292,11 @@ extern int of_add_property(struct device_node *np, struct property *prop);
extern int of_remove_property(struct device_node *np, struct property *prop);
extern int of_update_property(struct device_node *np, struct property *newprop);
+#define for_each_available_child_of_node(parent, child) \
+ for (child = of_get_next_available_child(parent, NULL); child != NULL; \
+ child = of_get_next_available_child(parent, child))
+
+
/* For updating the device tree at runtime */
#define OF_RECONFIG_ATTACH_NODE 0x0001
#define OF_RECONFIG_DETACH_NODE 0x0002