summaryrefslogtreecommitdiffstats
path: root/include/of.h
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-02-06 14:15:53 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-02-12 09:33:42 +0100
commit977be3d7156141ffc2207c268ecd7bbc854b5e2e (patch)
treef4afa1d173d726613f62e6a461dbc7095c0bce87 /include/of.h
parentd7dc46d5d6f2c80d1719ef877df728457790ac45 (diff)
downloadbarebox-977be3d7156141ffc2207c268ecd7bbc854b5e2e.tar.gz
barebox-977be3d7156141ffc2207c268ecd7bbc854b5e2e.tar.xz
of: Add for_each_child_of_node_safe
Needed for iterating over child nodes and deleting the children. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/of.h')
-rw-r--r--include/of.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/of.h b/include/of.h
index 5273f87ebd..2ad941864f 100644
--- a/include/of.h
+++ b/include/of.h
@@ -623,6 +623,8 @@ static inline struct device_node *of_find_matching_node(
for (dn = of_find_node_with_property(NULL, prop_name); dn; \
dn = of_find_node_with_property(dn, prop_name))
+#define for_each_child_of_node_safe(parent, tmp, child) \
+ list_for_each_entry_safe(child, tmp, &parent->children, parent_list)
#define for_each_child_of_node(parent, child) \
list_for_each_entry(child, &parent->children, parent_list)
#define for_each_available_child_of_node(parent, child) \