diff options
Diffstat (limited to 'arch/sparc64/kernel/irq.c')
-rw-r--r-- | arch/sparc64/kernel/irq.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c index a8c9dc8d1958..31e0fbb0d82c 100644 --- a/arch/sparc64/kernel/irq.c +++ b/arch/sparc64/kernel/irq.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/iommu.h> | 34 | #include <asm/iommu.h> |
35 | #include <asm/upa.h> | 35 | #include <asm/upa.h> |
36 | #include <asm/oplib.h> | 36 | #include <asm/oplib.h> |
37 | #include <asm/prom.h> | ||
37 | #include <asm/timer.h> | 38 | #include <asm/timer.h> |
38 | #include <asm/smp.h> | 39 | #include <asm/smp.h> |
39 | #include <asm/starfire.h> | 40 | #include <asm/starfire.h> |
@@ -635,23 +636,29 @@ static u64 prom_limit0, prom_limit1; | |||
635 | 636 | ||
636 | static void map_prom_timers(void) | 637 | static void map_prom_timers(void) |
637 | { | 638 | { |
638 | unsigned int addr[3]; | 639 | struct device_node *dp; |
639 | int tnode, err; | 640 | unsigned int *addr; |
640 | 641 | ||
641 | /* PROM timer node hangs out in the top level of device siblings... */ | 642 | /* PROM timer node hangs out in the top level of device siblings... */ |
642 | tnode = prom_finddevice("/counter-timer"); | 643 | dp = of_find_node_by_path("/"); |
644 | dp = dp->child; | ||
645 | while (dp) { | ||
646 | if (!strcmp(dp->name, "counter-timer")) | ||
647 | break; | ||
648 | dp = dp->sibling; | ||
649 | } | ||
643 | 650 | ||
644 | /* Assume if node is not present, PROM uses different tick mechanism | 651 | /* Assume if node is not present, PROM uses different tick mechanism |
645 | * which we should not care about. | 652 | * which we should not care about. |
646 | */ | 653 | */ |
647 | if (tnode == 0 || tnode == -1) { | 654 | if (!dp) { |
648 | prom_timers = (struct sun5_timer *) 0; | 655 | prom_timers = (struct sun5_timer *) 0; |
649 | return; | 656 | return; |
650 | } | 657 | } |
651 | 658 | ||
652 | /* If PROM is really using this, it must be mapped by him. */ | 659 | /* If PROM is really using this, it must be mapped by him. */ |
653 | err = prom_getproperty(tnode, "address", (char *)addr, sizeof(addr)); | 660 | addr = of_get_property(dp, "address", NULL); |
654 | if (err == -1) { | 661 | if (!addr) { |
655 | prom_printf("PROM does not have timer mapped, trying to continue.\n"); | 662 | prom_printf("PROM does not have timer mapped, trying to continue.\n"); |
656 | prom_timers = (struct sun5_timer *) 0; | 663 | prom_timers = (struct sun5_timer *) 0; |
657 | return; | 664 | return; |