/* Returns a node pointer with refcount incremented, use of_node_put() on it when done.  */
struct device_node* of_get_next_child(const struct device_node *node, struct device_node *prev)
/* Returns a node pointer with refcount incremented, use of_node_put() on it when done.  */
struct device_node* of_get_next_child(const struct device_node *node, struct device_node *prev)
{
	struct device_node *next;
	read_lock(&devtree_lock);
	next = prev ? prev->sibling : node->child;
	for (; next; next = next->sibling)
		if (of_node_get(next))
			break;
	of_node_put(prev);
	read_unlock(&devtree_lock);
	return next;
}