sparc: Move prom_build_devicetree() into prom_common.c

To make this work we provide a dummy nop implementation
of of_fill_in_cpu_data() for sparc32.

Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index 3b5de2f..95e8e5d 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -216,8 +216,8 @@
 	return buf;
 }
 
-struct device_node * __init prom_create_node(phandle node,
-					     struct device_node *parent)
+static struct device_node * __init prom_create_node(phandle node,
+						    struct device_node *parent)
 {
 	struct device_node *dp;
 
@@ -261,9 +261,9 @@
 	return n;
 }
 
-struct device_node * __init prom_build_tree(struct device_node *parent,
-					    phandle node,
-					    struct device_node ***nextp)
+static struct device_node * __init prom_build_tree(struct device_node *parent,
+						   phandle node,
+						   struct device_node ***nextp)
 {
 	struct device_node *ret = NULL, *prev_sibling = NULL;
 	struct device_node *dp;
@@ -293,3 +293,25 @@
 
 	return ret;
 }
+
+unsigned int prom_early_allocated __initdata;
+
+void __init prom_build_devicetree(void)
+{
+	struct device_node **nextp;
+
+	allnodes = prom_create_node(prom_root_node, NULL);
+	allnodes->path_component_name = "";
+	allnodes->full_name = "/";
+
+	nextp = &allnodes->allnext;
+	allnodes->child = prom_build_tree(allnodes,
+					  prom_getchild(allnodes->node),
+					  &nextp);
+	of_console_init();
+
+	printk("PROM: Built device tree with %u bytes of memory.\n",
+	       prom_early_allocated);
+
+	of_fill_in_cpu_data();
+}