Skip to content

Commit

Permalink
[PATCH] powerpc: add for_each_node_by_foo helpers
Browse files Browse the repository at this point in the history
Typical use for of_find_node_by_name and of_find_node_by_type is to
iterate over all nodes of a given type/name.  Add a helper macro to
do that (in spirit of the list_for_each* macros).

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Christoph Hellwig authored and Paul Mackerras committed Mar 17, 2006
1 parent d116fe5 commit e338522
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/asm-powerpc/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,14 @@ extern struct device_node *find_all_nodes(void);
/* New style node lookup */
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_compatible_node(struct device_node *from,
const char *type, const char *compat);
extern struct device_node *of_find_node_by_path(const char *path);
Expand Down

0 comments on commit e338522

Please sign in to comment.