[SPARC64]: Use in-kernel PROM tree for EBUS and ISA.

Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/include/asm-sparc64/ebus.h b/include/asm-sparc64/ebus.h
index 7a408a0..876912f 100644
--- a/include/asm-sparc64/ebus.h
+++ b/include/asm-sparc64/ebus.h
@@ -10,13 +10,13 @@
 
 #include <asm/pbm.h>
 #include <asm/oplib.h>
+#include <asm/prom.h>
 
 struct linux_ebus_child {
 	struct linux_ebus_child		*next;
 	struct linux_ebus_device	*parent;
 	struct linux_ebus		*bus;
-	int				 prom_node;
-	char				 prom_name[64];
+	struct device_node		*prom_node;
 	struct resource			 resource[PROMREG_MAX];
 	int				 num_addrs;
 	unsigned int			 irqs[PROMINTR_MAX];
@@ -27,8 +27,7 @@
 	struct linux_ebus_device	*next;
 	struct linux_ebus_child		*children;
 	struct linux_ebus		*bus;
-	int				 prom_node;
-	char				 prom_name[64];
+	struct device_node		*prom_node;
 	struct resource			 resource[PROMREG_MAX];
 	int				 num_addrs;
 	unsigned int			 irqs[PROMINTR_MAX];
@@ -42,8 +41,7 @@
 	struct pci_dev			*self;
 	int				 index;
 	int				 is_rio;
-	int				 prom_node;
-	char				 prom_name[64];
+	struct device_node		*prom_node;
 	struct linux_prom_ebus_ranges	 ebus_ranges[PROMREG_MAX];
 	int				 num_ebus_ranges;
 	struct linux_prom_ebus_intmap	 ebus_intmap[PROMREG_MAX];
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index 07ccd6f..f8d57bb 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -498,15 +498,14 @@
 #ifdef CONFIG_PCI
 static int __init ebus_fdthree_p(struct linux_ebus_device *edev)
 {
-	if (!strcmp(edev->prom_name, "fdthree"))
+	if (!strcmp(edev->prom_node->name, "fdthree"))
 		return 1;
-	if (!strcmp(edev->prom_name, "floppy")) {
-		char compat[16];
-		prom_getstring(edev->prom_node,
-			       "compatible",
-			       compat, sizeof(compat));
-		compat[15] = '\0';
-		if (!strcmp(compat, "fdthree"))
+	if (!strcmp(edev->prom_node->name, "floppy")) {
+		char *compat;
+
+		compat = of_get_property(edev->prom_node,
+					 "compatible", NULL);
+		if (compat && !strcmp(compat, "fdthree"))
 			return 1;
 	}
 	return 0;
@@ -524,12 +523,12 @@
 
 	for_each_isa(isa_br) {
 		for_each_isadev(isa_dev, isa_br) {
-			if (!strcmp(isa_dev->prom_name, "dma")) {
+			if (!strcmp(isa_dev->prom_node->name, "dma")) {
 				struct sparc_isa_device *child =
 					isa_dev->child;
 
 				while (child) {
-					if (!strcmp(child->prom_name,
+					if (!strcmp(child->prom_node->name,
 						    "floppy")) {
 						isa_dev = child;
 						goto isa_done;
@@ -614,6 +613,7 @@
 		struct linux_ebus_device *edev = NULL;
 		unsigned long config = 0;
 		void __iomem *auxio_reg;
+		char *state_prop;
 
 		for_each_ebus(ebus) {
 			for_each_ebusdev(edev, ebus) {
@@ -630,9 +630,8 @@
 #endif
 		}
 
-		prom_getproperty(edev->prom_node, "status",
-				 state, sizeof(state));
-		if (!strncmp(state, "disabled", 8))
+		state_prop = of_get_property(edev->prom_node, "status", NULL);
+		if (state_prop && !strncmp(state_prop, "disabled", 8))
 			return 0;
 			
 		FLOPPY_IRQ = edev->irqs[0];
@@ -703,7 +702,7 @@
 		 */
 		for_each_ebus(ebus) {
 			for_each_ebusdev(edev, ebus) {
-				if (!strcmp(edev->prom_name, "ecpp")) {
+				if (!strcmp(edev->prom_node->name, "ecpp")) {
 					config = edev->resource[1].start;
 					goto config_done;
 				}
diff --git a/include/asm-sparc64/isa.h b/include/asm-sparc64/isa.h
index 4601bbf..e110435 100644
--- a/include/asm-sparc64/isa.h
+++ b/include/asm-sparc64/isa.h
@@ -9,6 +9,7 @@
 
 #include <asm/pbm.h>
 #include <asm/oplib.h>
+#include <asm/prom.h>
 
 struct sparc_isa_bridge;
 
@@ -16,9 +17,7 @@
 	struct sparc_isa_device	*next;
 	struct sparc_isa_device	*child;
 	struct sparc_isa_bridge	*bus;
-	int			prom_node;
-	char			prom_name[64];
-	char			compatible[64];
+	struct device_node	*prom_node;
 	struct resource		resource;
 	unsigned int		irq;
 };
@@ -29,8 +28,7 @@
 	struct pci_pbm_info	*parent;
 	struct pci_dev		*self;
 	int			index;
-	int			prom_node;
-	char			prom_name[64];
+	struct device_node	*prom_node;
 #define linux_prom_isa_ranges linux_prom_ebus_ranges
 	struct linux_prom_isa_ranges	isa_ranges[PROMREG_MAX];
 	int			num_isa_ranges;
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index 56b5197..d389587 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -67,18 +67,17 @@
 
 static int ebus_ecpp_p(struct linux_ebus_device *edev)
 {
-	if (!strcmp(edev->prom_name, "ecpp"))
+	if (!strcmp(edev->prom_node->name, "ecpp"))
 		return 1;
-	if (!strcmp(edev->prom_name, "parallel")) {
-		char compat[19];
-		prom_getstring(edev->prom_node,
-			       "compatible",
-			       compat, sizeof(compat));
-		compat[18] = '\0';
-		if (!strcmp(compat, "ecpp"))
-			return 1;
-		if (!strcmp(compat, "ns87317-ecpp") &&
-		    !strcmp(compat + 13, "ecpp"))
+	if (!strcmp(edev->prom_node->name, "parallel")) {
+		char *compat;
+
+		compat = of_get_property(edev->prom_node,
+					 "compatible", NULL);
+		if (compat &&
+		    (!strcmp(compat, "ecpp") ||
+		     !strcmp(compat, "ns87317-ecpp") ||
+		     !strcmp(compat + 13, "ecpp")))
 			return 1;
 	}
 	return 0;
@@ -94,12 +93,12 @@
 			struct sparc_isa_device *child;
 			unsigned long base;
 
-			if (strcmp(isa_dev->prom_name, "dma"))
+			if (strcmp(isa_dev->prom_node->name, "dma"))
 				continue;
 
 			child = isa_dev->child;
 			while (child) {
-				if (!strcmp(child->prom_name, "parallel"))
+				if (!strcmp(child->prom_node->name, "parallel"))
 					break;
 				child = child->next;
 			}