of: merge of_find_all_nodes() implementations

Merge common code between Microblaze and PowerPC, and make it available
to Sparc

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Michal Simek <monstr@monstr.eu>
Acked-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
diff --git a/include/linux/of.h b/include/linux/of.h
index 4636bba..e7facd8 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -79,6 +79,8 @@
 	dn->pde = de;
 }
 
+extern struct device_node *of_find_all_nodes(struct device_node *prev);
+
 #if defined(CONFIG_SPARC)
 /* Dummy ref counting routines - to be implemented later */
 static inline struct device_node *of_node_get(struct device_node *node)
@@ -90,7 +92,6 @@
 }
 
 #else
-extern struct device_node *of_find_all_nodes(struct device_node *prev);
 extern struct device_node *of_node_get(struct device_node *node);
 extern void of_node_put(struct device_node *node);
 #endif