Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29550
b: refs/heads/master
c: aaf7cec
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jun 24, 2006
1 parent 322bf50 commit 7fc55b4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 372b07bb5a13f8a1b8a3ce49cd76d39a79dbd3bd
refs/heads/master: aaf7cec2769942035985716452107fc5ba0b11f6
26 changes: 26 additions & 0 deletions trunk/arch/sparc64/kernel/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,32 @@ struct device_node *of_find_node_by_path(const char *path)
return np;
}

struct device_node *of_find_node_by_name(struct device_node *from,
const char *name)
{
struct device_node *np;

np = from ? from->allnext : allnodes;
for (; np != NULL; np = np->allnext)
if (np->name != NULL && strcmp(np->name, name) == 0)
break;

return np;
}

struct device_node *of_find_node_by_type(struct device_node *from,
const char *type)
{
struct device_node *np;

np = from ? from->allnext : allnodes;
for (; np != 0; np = np->allnext)
if (np->type != 0 && strcmp(np->type, type) == 0)
break;

return np;
}

struct property *of_find_property(struct device_node *np, const char *name,
int *lenp)
{
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/asm-sparc64/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_e
dn->pde = de;
}

extern struct device_node *of_find_node_by_name(struct device_node *from,
const char *name);
#define for_each_node_by_name(dn, name) \
for (dn = of_find_node_by_name(NULL, name); dn; \
dn = of_find_node_by_name(dn, name))
extern struct device_node *of_find_node_by_type(struct device_node *from,
const char *type);
#define for_each_node_by_type(dn, type) \
for (dn = of_find_node_by_type(NULL, type); dn; \
dn = of_find_node_by_type(dn, type))
extern struct device_node *of_find_node_by_path(const char *path);
extern struct device_node *of_get_parent(const struct device_node *node);
extern struct device_node *of_get_next_child(const struct device_node *node,
Expand Down

0 comments on commit 7fc55b4

Please sign in to comment.