of_get_next_available_child does not iterate but always tries the same node over and over again. This first prepares the entry and then uses list_for_each_entry_continue, instead of for_each_child_of_node before. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@xxxxxxxxx> --- Note: This should be the last iterator fix required. I have tested all for_each_ helpers. Thanks for Hiroki for reporting this and the initial quick fix. Unfortunately, I found this one after I sent the patch set. Cc: barebox@xxxxxxxxxxxxxxxxxxx Cc: Hiroki Nishimoto <hiroki.nishimoto.if@xxxxxxxxx> --- drivers/of/base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/of/base.c b/drivers/of/base.c index 0500c86..8c6dbcf 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -1352,7 +1352,8 @@ EXPORT_SYMBOL(of_get_parent); struct device_node *of_get_next_available_child(const struct device_node *node, struct device_node *prev) { - for_each_child_of_node(node, prev) + prev = list_prepare_entry(prev, &node->children, parent_list); + list_for_each_entry_continue(prev, &node->children, parent_list) if (of_device_is_available(prev)) return prev; return NULL; -- 1.7.10.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox