[POWERPC] Add for_each_compatible_node()
authorMichael Ellerman <michael@ellerman.id.au>
Mon, 4 Jun 2007 13:00:02 +0000 (23:00 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 25 Jun 2007 07:02:08 +0000 (17:02 +1000)
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
include/asm-powerpc/prom.h

index 6845af9..1122a92 100644 (file)
@@ -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);