9
0
Fork 0

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:
Sebastian Hesselbarth 2013-07-04 01:18:41 +02:00 committed by Sascha Hauer
parent 73986cc87d
commit f457f683cb
1 changed files with 2 additions and 1 deletions

View File

@ -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;