summaryrefslogtreecommitdiff
path: root/arch/sparc64/kernel
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-22 20:21:22 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-23 23:15:36 -0700
commit25c7581bcdd11cf9b82a8ef062a10bea310cc9e9 (patch)
treec88f4ee5e91fa7921ff13627f373e1bfbcec8b81 /arch/sparc64/kernel
parent44bdef5e8f2e64ba5974b587989a829d57126bad (diff)
downloadlwn-25c7581bcdd11cf9b82a8ef062a10bea310cc9e9.tar.gz
lwn-25c7581bcdd11cf9b82a8ef062a10bea310cc9e9.zip
[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')
-rw-r--r--arch/sparc64/kernel/irq.c18
-rw-r--r--arch/sparc64/kernel/sbus.c29
2 files changed, 28 insertions, 19 deletions
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index a8c9dc8d1958..2d00ccffc55b 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -34,6 +34,7 @@
#include <asm/iommu.h>
#include <asm/upa.h>
#include <asm/oplib.h>
+#include <asm/prom.h>
#include <asm/timer.h>
#include <asm/smp.h>
#include <asm/starfire.h>
@@ -635,23 +636,30 @@ static u64 prom_limit0, prom_limit1;
static void map_prom_timers(void)
{
- unsigned int addr[3];
+ struct device_node *dp;
+ unsigned int *addr;
int tnode, err;
/* PROM timer node hangs out in the top level of device siblings... */
- tnode = prom_finddevice("/counter-timer");
+ dp = of_find_node_by_path("/");
+ dp = dp->child;
+ while (dp) {
+ if (!strcmp(dp->name, "counter-timer"))
+ break;
+ dp = dp->sibling;
+ }
/* Assume if node is not present, PROM uses different tick mechanism
* which we should not care about.
*/
- if (tnode == 0 || tnode == -1) {
+ if (!dp) {
prom_timers = (struct sun5_timer *) 0;
return;
}
/* If PROM is really using this, it must be mapped by him. */
- err = prom_getproperty(tnode, "address", (char *)addr, sizeof(addr));
- if (err == -1) {
+ addr = of_get_property(dp, "address", NULL);
+ if (!addr) {
prom_printf("PROM does not have timer mapped, trying to continue.\n");
prom_timers = (struct sun5_timer *) 0;
return;
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 @@
#include <asm/cache.h>
#include <asm/dma.h>
#include <asm/irq.h>
+#include <asm/prom.h>
#include <asm/starfire.h>
#include "iommu_common.h"
@@ -1098,24 +1099,25 @@ static void __init sysio_register_error_handlers(struct sbus_bus *sbus)
}
/* Boot time initialization. */
-void __init sbus_iommu_init(int prom_node, struct sbus_bus *sbus)
+void __init sbus_iommu_init(int __node, struct sbus_bus *sbus)
{
- struct linux_prom64_registers rprop;
+ struct linux_prom64_registers *pr;
+ struct device_node *dp;
struct sbus_iommu *iommu;
unsigned long regs, tsb_base;
u64 control;
- int err, i;
+ int i;
+
+ dp = of_find_node_by_phandle(__node);
- sbus->portid = prom_getintdefault(sbus->prom_node,
- "upa-portid", -1);
+ sbus->portid = of_getintprop_default(dp, "upa-portid", -1);
- err = prom_getproperty(prom_node, "reg",
- (char *)&rprop, sizeof(rprop));
- if (err < 0) {
+ pr = of_get_property(dp, "reg", NULL);
+ if (!pr) {
prom_printf("sbus_iommu_init: Cannot map SYSIO control registers.\n");
prom_halt();
}
- regs = rprop.phys_addr;
+ regs = pr->phys_addr;
iommu = kmalloc(sizeof(*iommu) + SMP_CACHE_BYTES, GFP_ATOMIC);
if (iommu == NULL) {
@@ -1228,12 +1230,11 @@ void __init sbus_iommu_init(int prom_node, struct sbus_bus *sbus)
void sbus_fill_device_irq(struct sbus_dev *sdev)
{
- struct linux_prom_irqs irqs[PROMINTR_MAX];
- int len;
+ struct device_node *dp = of_find_node_by_phandle(sdev->prom_node);
+ struct linux_prom_irqs *irqs;
- len = prom_getproperty(sdev->prom_node, "interrupts",
- (char *) irqs, sizeof(irqs));
- if (len == -1 || len == 0) {
+ irqs = of_get_property(dp, "interrupts", NULL);
+ if (!irqs) {
sdev->irqs[0] = 0;
sdev->num_irqs = 0;
} else {