/* Returns a node pointer with refcount incremented, use of_node_put() on it when done.  */
struct device_node* of_find_all_nodes(struct device_node *prev)
/* Returns a node pointer with refcount incremented, use of_node_put() on it when done.  */
struct device_node* of_find_all_nodes(struct device_node *prev)
{
	struct device_node *np;
	read_lock(&devtree_lock);
	np = prev ? prev->allnext : allnodes;
	for (; np != NULL; np = np->allnext)
		if (of_node_get(np))
			break;
	of_node_put(prev);
	read_unlock(&devtree_lock);
	return np;
}