[PATCH 01/17] of: Add for_each_child_of_node_safe
Sascha Hauer
s.hauer at pengutronix.de
Thu Feb 12 00:54:18 PST 2015
Needed for iterating over child nodes and deleting the children.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
include/of.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/of.h b/include/of.h
index 5273f87..2ad9418 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) \
--
2.1.4
More information about the barebox
mailing list