Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62182
b: refs/heads/master
c: d1cd355
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Rothwell committed Jul 20, 2007
1 parent 7ef90b3 commit b52d9ea
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 53 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e679c5f445fe142940e0962de9c5c82f10d9357c
refs/heads/master: d1cd355a5e44dfe993efc0c0458ca9f99a28a9a3
24 changes: 0 additions & 24 deletions trunk/arch/powerpc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,30 +1240,6 @@ struct device_node *of_find_all_nodes(struct device_node *prev)
}
EXPORT_SYMBOL(of_find_all_nodes);

/**
* of_get_next_child - Iterate a node childs
* @node: parent node
* @prev: previous child of the parent node, or NULL to get first
*
* 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 != 0; next = next->sibling)
if (of_node_get(next))
break;
of_node_put(prev);
read_unlock(&devtree_lock);
return next;
}
EXPORT_SYMBOL(of_get_next_child);

/**
* of_node_get - Increment refcount of a node
* @node: Node to inc refcount, NULL is supported to
Expand Down
14 changes: 0 additions & 14 deletions trunk/arch/sparc/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@ static struct device_node *allnodes;

extern rwlock_t devtree_lock; /* temporary while merging */

struct device_node *of_get_next_child(const struct device_node *node,
struct device_node *prev)
{
struct device_node *next;

next = prev ? prev->sibling : node->child;
for (; next != 0; next = next->sibling) {
break;
}

return next;
}
EXPORT_SYMBOL(of_get_next_child);

struct device_node *of_find_node_by_path(const char *path)
{
struct device_node *np = allnodes;
Expand Down
14 changes: 0 additions & 14 deletions trunk/arch/sparc64/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,6 @@ static struct device_node *allnodes;

extern rwlock_t devtree_lock; /* temporary while merging */

struct device_node *of_get_next_child(const struct device_node *node,
struct device_node *prev)
{
struct device_node *next;

next = prev ? prev->sibling : node->child;
for (; next != 0; next = next->sibling) {
break;
}

return next;
}
EXPORT_SYMBOL(of_get_next_child);

struct device_node *of_find_node_by_path(const char *path)
{
struct device_node *np = allnodes;
Expand Down
24 changes: 24 additions & 0 deletions trunk/drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,27 @@ struct device_node *of_get_parent(const struct device_node *node)
return np;
}
EXPORT_SYMBOL(of_get_parent);

/**
* of_get_next_child - Iterate a node childs
* @node: parent node
* @prev: previous child of the parent node, or NULL to get first
*
* 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;
}
EXPORT_SYMBOL(of_get_next_child);

0 comments on commit b52d9ea

Please sign in to comment.