Commit e3385222 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Paul Mackerras

[PATCH] powerpc: add for_each_node_by_foo helpers

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent d116fe5a
...@@ -126,8 +126,14 @@ extern struct device_node *find_all_nodes(void); ...@@ -126,8 +126,14 @@ extern struct device_node *find_all_nodes(void);
/* New style node lookup */ /* New style node lookup */
extern struct device_node *of_find_node_by_name(struct device_node *from, extern struct device_node *of_find_node_by_name(struct device_node *from,
const char *name); 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, extern struct device_node *of_find_node_by_type(struct device_node *from,
const char *type); 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, extern struct device_node *of_find_compatible_node(struct device_node *from,
const char *type, const char *compat); const char *type, const char *compat);
extern struct device_node *of_find_node_by_path(const char *path); extern struct device_node *of_find_node_by_path(const char *path);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment