OF: base: fix iterator in of_get_next_available_child
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@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
73986cc87d
commit
f457f683cb
|
@ -1380,7 +1380,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;
|
||||
|
|
Loading…
Reference in New Issue