aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/sbus.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-22 23:21:22 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-24 02:15:36 -0400
commit25c7581bcdd11cf9b82a8ef062a10bea310cc9e9 (patch)
treec88f4ee5e91fa7921ff13627f373e1bfbcec8b81 /arch/sparc64/kernel/sbus.c
parent44bdef5e8f2e64ba5974b587989a829d57126bad (diff)
[SPARC64]: Kill off some more prom_getproperty() remnants.
The remaining ones occur before we have imported the device tree. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/sbus.c')
-rw-r--r--arch/sparc64/kernel/sbus.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/arch/sparc64/kernel/sbus.c b/arch/sparc64/kernel/sbus.c
index 8f7877ac858f..a72bba398809 100644
--- a/arch/sparc64/kernel/sbus.c
+++ b/arch/sparc64/kernel/sbus.c
@@ -19,6 +19,7 @@
19#include <asm/cache.h> 19#include <asm/cache.h>
20#include <asm/dma.h> 20#include <asm/dma.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/prom.h>
22#include <asm/starfire.h> 23#include <asm/starfire.h>
23 24
24#include "iommu_common.h" 25#include "iommu_common.h"
@@ -1098,24 +1099,25 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus)
1098} 1099}
1099 1100
1100/* Boot time initialization. */ 1101/* Boot time initialization. */
1101void __init sbus_iommu_init(int prom_node, struct sbus_bus *sbus) 1102void __init sbus_iommu_init(int __node, struct sbus_bus *sbus)
1102{ 1103{
1103 struct linux_prom64_registers rprop; 1104 struct linux_prom64_registers *pr;
1105 struct device_node *dp;
1104 struct sbus_iommu *iommu; 1106 struct sbus_iommu *iommu;
1105 unsigned long regs, tsb_base; 1107 unsigned long regs, tsb_base;
1106 u64 control; 1108 u64 control;
1107 int err, i; 1109 int i;
1110
1111 dp = of_find_node_by_phandle(__node);
1108 1112
1109 sbus->portid = prom_getintdefault(sbus->prom_node, 1113 sbus->portid = of_getintprop_default(dp, "upa-portid", -1);
1110 "upa-portid", -1);
1111 1114
1112 err = prom_getproperty(prom_node, "reg", 1115 pr = of_get_property(dp, "reg", NULL);
1113 (char *)&rprop, sizeof(rprop)); 1116 if (!pr) {
1114 if (err < 0) {
1115 prom_printf("sbus_iommu_init: Cannot map SYSIO control registers.\n"); 1117 prom_printf("sbus_iommu_init: Cannot map SYSIO control registers.\n");
1116 prom_halt(); 1118 prom_halt();
1117 } 1119 }
1118 regs = rprop.phys_addr; 1120 regs = pr->phys_addr;
1119 1121
1120 iommu = kmalloc(sizeof(*iommu) + SMP_CACHE_BYTES, GFP_ATOMIC); 1122 iommu = kmalloc(sizeof(*iommu) + SMP_CACHE_BYTES, GFP_ATOMIC);
1121 if (iommu == NULL) { 1123 if (iommu == NULL) {
@@ -1228,12 +1230,11 @@ void __init sbus_iommu_init(int prom_node, struct sbus_bus *sbus)
1228 1230
1229void sbus_fill_device_irq(struct sbus_dev *sdev) 1231void sbus_fill_device_irq(struct sbus_dev *sdev)
1230{ 1232{
1231 struct linux_prom_irqs irqs[PROMINTR_MAX]; 1233 struct device_node *dp = of_find_node_by_phandle(sdev->prom_node);
1232 int len; 1234 struct linux_prom_irqs *irqs;
1233 1235
1234 len = prom_getproperty(sdev->prom_node, "interrupts", 1236 irqs = of_get_property(dp, "interrupts", NULL);
1235 (char *) irqs, sizeof(irqs)); 1237 if (!irqs) {
1236 if (len == -1 || len == 0) {
1237 sdev->irqs[0] = 0; 1238 sdev->irqs[0] = 0;
1238 sdev->num_irqs = 0; 1239 sdev->num_irqs = 0;
1239 } else { 1240 } else {