]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix rtc symbol clash and HPET config problems
authorAndrew Morton <akpm@osdl.org>
Wed, 3 Sep 2003 18:11:51 +0000 (11:11 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 3 Sep 2003 18:11:51 +0000 (11:11 -0700)
The new HPET RTC emulation code uses a function in rtc.c, get_rtc_time().

So that function was made non-static.  Problem is, the same function name is
used elsewhere by some architectures, so there will be linkage problems.

And rtc_get_time() is used too, so I renamed it to rtc_get_rtc_time().

Also, the HPET code was setting CONFIG_HPET_EMULATE_RTC by hand in a header
file.  Fix it to use the Kconfig system properly.

arch/i386/Kconfig
arch/i386/kernel/time_hpet.c
drivers/char/rtc.c
include/asm-i386/hpet.h
include/linux/rtc.h

index fa32ee149abcede203fea21704d5cc76e187bca0..928c42588f10de0242e056664f7b213ee3c37706 100644 (file)
@@ -419,6 +419,9 @@ config HPET_TIMER
 
          Choose N to continue using the legacy 8254 timer.
 
+config HPET_EMULATE_RTC
+       def_bool HPET_TIMER && RTC=y
+
 config SMP
        bool "Symmetric multi-processing support"
        ---help---
index 7c0d0e7407a0fb91ecf8d6d497db7bb1797e1411..3ea82f9731f4eab0a8fde51d68df1c3cbb2f5cb2 100644 (file)
@@ -187,7 +187,6 @@ __setup("hpet=", hpet_setup);
 #include <linux/rtc.h>
 
 extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-extern void get_rtc_time(struct rtc_time *rtc_tm);
 
 #define DEFAULT_RTC_INT_FREQ   64
 #define RTC_NUM_INTS           1
@@ -354,7 +353,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        hpet_rtc_timer_reinit();
 
        if (UIE_on | AIE_on) {
-               get_rtc_time(&curr_time);
+               rtc_get_rtc_time(&curr_time);
        }
        if (UIE_on) {
                if (curr_time.tm_sec != prev_update_sec) {
index 309a173c821d2f690c3614907b2b3403929e0619..166002b12674e63cb73b12f898eb723be4aab205 100644 (file)
@@ -137,7 +137,6 @@ static int rtc_ioctl(struct inode *inode, struct file *file,
 static unsigned int rtc_poll(struct file *file, poll_table *wait);
 #endif
 
-void get_rtc_time (struct rtc_time *rtc_tm);
 static void get_rtc_alm_time (struct rtc_time *alm_tm);
 #if RTC_IRQ
 static void rtc_dropped_irq(unsigned long data);
@@ -482,7 +481,7 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)
        }
        case RTC_RD_TIME:       /* Read the time/date from RTC  */
        {
-               get_rtc_time(&wtime);
+               rtc_get_rtc_time(&wtime);
                break;
        }
        case RTC_SET_TIME:      /* Set the RTC */
@@ -1119,7 +1118,7 @@ static int rtc_proc_output (char *buf)
 
        p = buf;
 
-       get_rtc_time(&tm);
+       rtc_get_rtc_time(&tm);
 
        /*
         * There is no way to tell if the luser has the RTC set for local
@@ -1206,7 +1205,7 @@ static inline unsigned char rtc_is_updating(void)
        return uip;
 }
 
-void get_rtc_time(struct rtc_time *rtc_tm)
+void rtc_get_rtc_time(struct rtc_time *rtc_tm)
 {
        unsigned long uip_watchdog = jiffies;
        unsigned char ctrl;
index 8890ea1fdb4eb979b6112c050a675e1a58a39c06..ffc472ff541838542165e0ea017d712770238efb 100644 (file)
@@ -102,8 +102,7 @@ extern int is_hpet_capable(void);
 extern int hpet_readl(unsigned long a);
 extern void hpet_writel(unsigned long d, unsigned long a);
 
-#ifdef CONFIG_RTC
-#define CONFIG_HPET_EMULATE_RTC        1
+#ifdef CONFIG_HPET_EMULATE_RTC
 extern int hpet_mask_rtc_irq_bit(unsigned long bit_mask);
 extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
 extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min, unsigned char sec);
@@ -111,6 +110,6 @@ extern int hpet_set_periodic_freq(unsigned long freq);
 extern int hpet_rtc_dropped_irq(void);
 extern int hpet_rtc_timer_init(void);
 extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs);
-#endif /* CONFIG_RTC */
+#endif /* CONFIG_HPET_EMULATE_RTC */
 #endif /* CONFIG_HPET_TIMER */
 #endif /* _I386_HPET_H */
index 27c38b240736058061cab1f91d7bbce5bbe04c6b..e1aaf1fac8e0e7aadb5c4745462af1623a8d41fb 100644 (file)
@@ -101,6 +101,7 @@ typedef struct rtc_task {
 int rtc_register(rtc_task_t *task);
 int rtc_unregister(rtc_task_t *task);
 int rtc_control(rtc_task_t *t, unsigned int cmd, unsigned long arg);
+void rtc_get_rtc_time(struct rtc_time *rtc_tm);
 
 #endif /* __KERNEL__ */