]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/rtc.c
legacy rtc: remove needless/confusing HPET_RTC_IRQ option
[linux-2.6-omap-h63xx.git] / drivers / char / rtc.c
index d9799e2bcfbfb128dfc583866fbc40cfcc0d1184..17683de95717e2a2b5eb763fa345ce418fed6181 100644 (file)
@@ -78,7 +78,6 @@
 #include <linux/wait.h>
 #include <linux/bcd.h>
 #include <linux/delay.h>
-#include <linux/smp_lock.h>
 #include <linux/uaccess.h>
 
 #include <asm/current.h>
 #endif
 
 #ifdef CONFIG_SPARC32
-#include <linux/pci.h>
-#include <linux/jiffies.h>
-#include <asm/ebus.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <asm/io.h>
 
 static unsigned long rtc_port;
-static int rtc_irq = PCI_IRQ_NONE;
+static int rtc_irq;
 #endif
 
-#ifdef CONFIG_HPET_RTC_IRQ
+#ifdef CONFIG_HPET_EMULATE_RTC
 #undef RTC_IRQ
 #endif
 
@@ -974,8 +973,8 @@ static int __init rtc_init(void)
        char *guess = NULL;
 #endif
 #ifdef CONFIG_SPARC32
-       struct linux_ebus *ebus;
-       struct linux_ebus_device *edev;
+       struct device_node *ebus_dp;
+       struct of_device *op;
 #else
        void *r;
 #ifdef RTC_IRQ
@@ -984,12 +983,16 @@ static int __init rtc_init(void)
 #endif
 
 #ifdef CONFIG_SPARC32
-       for_each_ebus(ebus) {
-               for_each_ebusdev(edev, ebus) {
-                       if (strcmp(edev->prom_node->name, "rtc") == 0) {
-                               rtc_port = edev->resource[0].start;
-                               rtc_irq = edev->irqs[0];
-                               goto found;
+       for_each_node_by_name(ebus_dp, "ebus") {
+               struct device_node *dp;
+               for (dp = ebus_dp; dp; dp = dp->sibling) {
+                       if (!strcmp(dp->name, "rtc")) {
+                               op = of_find_device_by_node(dp);
+                               if (op) {
+                                       rtc_port = op->resource[0].start;
+                                       rtc_irq = op->irqs[0];
+                                       goto found;
+                               }
                        }
                }
        }
@@ -998,7 +1001,7 @@ static int __init rtc_init(void)
        return -EIO;
 
 found:
-       if (rtc_irq == PCI_IRQ_NONE) {
+       if (!rtc_irq) {
                rtc_has_irq = 0;
                goto no_irq;
        }