From: Michael Ellerman Date: Mon, 4 Jun 2007 13:00:02 +0000 (+1000) Subject: [POWERPC] Add for_each_compatible_node() X-Git-Tag: v2.6.23-rc1~767^2^2~152 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3855fa5540617877907ca61c36d28e18d0f2473;p=linux-2.6 [POWERPC] Add for_each_compatible_node() Signed-off-by: Michael Ellerman Acked-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 6845af93ba..1122a9278a 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h @@ -124,6 +124,9 @@ extern struct device_node *of_find_node_by_type(struct device_node *from, 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); +#define for_each_compatible_node(dn, type, compatible) \ + for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ + dn = of_find_compatible_node(dn, type, compatible)) extern struct device_node *of_find_node_by_path(const char *path); extern struct device_node *of_find_node_by_phandle(phandle handle); extern struct device_node *of_find_all_nodes(struct device_node *prev);