aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-30 03:23:51 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-30 03:23:51 -0400
commit75081322c9d0d56f8880178f9fcc93778bcf0220 (patch)
treec9929d7f16b31420e398c3db6af2f326a86a4faa
parentafc88ad6b38797aeec4d635140099ace077df587 (diff)
sparc32: Convert PC RTC probing to pure OF driver.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/char/rtc.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index f53d4d00faf0..b47710c17885 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -88,12 +88,12 @@
88#endif 88#endif
89 89
90#ifdef CONFIG_SPARC32 90#ifdef CONFIG_SPARC32
91#include <linux/pci.h> 91#include <linux/of.h>
92#include <linux/jiffies.h> 92#include <linux/of_device.h>
93#include <asm/ebus.h> 93#include <asm/io.h>
94 94
95static unsigned long rtc_port; 95static unsigned long rtc_port;
96static int rtc_irq = PCI_IRQ_NONE; 96static int rtc_irq;
97#endif 97#endif
98 98
99#ifdef CONFIG_HPET_RTC_IRQ 99#ifdef CONFIG_HPET_RTC_IRQ
@@ -973,8 +973,8 @@ static int __init rtc_init(void)
973 char *guess = NULL; 973 char *guess = NULL;
974#endif 974#endif
975#ifdef CONFIG_SPARC32 975#ifdef CONFIG_SPARC32
976 struct linux_ebus *ebus; 976 struct device_node *ebus_dp;
977 struct linux_ebus_device *edev; 977 struct of_device *op;
978#else 978#else
979 void *r; 979 void *r;
980#ifdef RTC_IRQ 980#ifdef RTC_IRQ
@@ -983,12 +983,16 @@ static int __init rtc_init(void)
983#endif 983#endif
984 984
985#ifdef CONFIG_SPARC32 985#ifdef CONFIG_SPARC32
986 for_each_ebus(ebus) { 986 for_each_node_by_name(ebus_dp, "ebus") {
987 for_each_ebusdev(edev, ebus) { 987 struct device_node *dp;
988 if (strcmp(edev->prom_node->name, "rtc") == 0) { 988 for (dp = ebus_dp; dp; dp = dp->sibling) {
989 rtc_port = edev->resource[0].start; 989 if (!strcmp(dp->name, "rtc")) {
990 rtc_irq = edev->irqs[0]; 990 op = of_find_device_by_node(dp);
991 goto found; 991 if (op) {
992 rtc_port = op->resource[0].start;
993 rtc_irq = op->irqs[0];
994 goto found;
995 }
992 } 996 }
993 } 997 }
994 } 998 }
@@ -997,7 +1001,7 @@ static int __init rtc_init(void)
997 return -EIO; 1001 return -EIO;
998 1002
999found: 1003found:
1000 if (rtc_irq == PCI_IRQ_NONE) { 1004 if (!rtc_irq) {
1001 rtc_has_irq = 0; 1005 rtc_has_irq = 0;
1002 goto no_irq; 1006 goto no_irq;
1003 } 1007 }