Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f8f76481bc2803aea03ff213c7e1405b53f7e488
Commit:     f8f76481bc2803aea03ff213c7e1405b53f7e488
Parent:     1bdbdaacf774f2979ed4cb0c4a4316c9e578c897
Author:     Bernhard Walle <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:33:31 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:33:31 2008 +0100

    rtc: use the IRQ callback interface in (old) RTC driver
    
    the previous patch in the old RTC driver.  It also removes the direct
    rtc_interrupt() call from arch/x86/kernel/hpetc.c so that there's finally no
    (code) dependency to CONFIG_RTC in arch/x86/kernel/hpet.c.
    
    Because of this, it's possible to compile the drivers/char/rtc.ko driver as
    module and still use the HPET emulation functionality.  This is also 
expressed
    in Kconfig.
    
    Signed-off-by: Bernhard Walle <[EMAIL PROTECTED]>
    Cc: Alessandro Zummo <[EMAIL PROTECTED]>
    Cc: David Brownell <[EMAIL PROTECTED]>
    Cc: Andi Kleen <[EMAIL PROTECTED]>
    Cc: john stultz <[EMAIL PROTECTED]>
    Cc: Robert Picco <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/Kconfig       |    2 +-
 arch/x86/kernel/hpet.c |    2 --
 drivers/char/rtc.c     |   15 ++++++++++++++-
 3 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 81af31e..4e911d0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -390,7 +390,7 @@ config HPET_TIMER
 
 config HPET_EMULATE_RTC
        def_bool y
-       depends on HPET_TIMER && RTC=y
+       depends on HPET_TIMER && (RTC=y || RTC=m)
 
 # Mark as embedded because too many people got it wrong.
 # The code disables itself when not needed.
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index d65ced5..429d084 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -705,8 +705,6 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
                rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8));
                if (irq_handler)
                        irq_handler(rtc_int_flag, dev_id);
-
-               rtc_interrupt(rtc_int_flag, dev_id);
        }
        return IRQ_HANDLED;
 }
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 3ac7952..78b151c 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -110,6 +110,8 @@ static int rtc_has_irq = 1;
 #define hpet_set_rtc_irq_bit(arg)              0
 #define hpet_rtc_timer_init()                  do { } while (0)
 #define hpet_rtc_dropped_irq()                 0
+#define hpet_register_irq_handler(h)           0
+#define hpet_unregister_irq_handler(h)         0
 #ifdef RTC_IRQ
 static irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
 {
@@ -1027,7 +1029,15 @@ no_irq:
 
 #ifdef RTC_IRQ
        if (is_hpet_enabled()) {
+               int err;
+
                rtc_int_handler_ptr = hpet_rtc_interrupt;
+               err = hpet_register_irq_handler(rtc_interrupt);
+               if (err != 0) {
+                       printk(KERN_WARNING "hpet_register_irq_handler failed "
+                                       "in rtc_init().");
+                       return err;
+               }
        } else {
                rtc_int_handler_ptr = rtc_interrupt;
        }
@@ -1050,6 +1060,7 @@ no_irq:
        if (misc_register(&rtc_dev)) {
 #ifdef RTC_IRQ
                free_irq(RTC_IRQ, NULL);
+               hpet_unregister_irq_handler(rtc_interrupt);
                rtc_has_irq = 0;
 #endif
                rtc_release_region();
@@ -1141,8 +1152,10 @@ static void __exit rtc_exit(void)
 #else
        rtc_release_region();
 #ifdef RTC_IRQ
-       if (rtc_has_irq)
+       if (rtc_has_irq) {
                free_irq(RTC_IRQ, NULL);
+               hpet_unregister_irq_handler(hpet_rtc_interrupt);
+       }
 #endif
 #endif /* CONFIG_SPARC32 */
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to