From 56928c850640733f7368c2ed2293cd26b6eea772 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 3 Sep 2003 11:11:51 -0700 Subject: [PATCH] [PATCH] Fix rtc symbol clash and HPET config problems 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 | 3 +++ arch/i386/kernel/time_hpet.c | 3 +-- drivers/char/rtc.c | 7 +++---- include/asm-i386/hpet.h | 5 ++--- include/linux/rtc.h | 1 + 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index fa32ee149abce..928c42588f10d 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -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--- diff --git a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c index 7c0d0e7407a0f..3ea82f9731f4e 100644 --- a/arch/i386/kernel/time_hpet.c +++ b/arch/i386/kernel/time_hpet.c @@ -187,7 +187,6 @@ __setup("hpet=", hpet_setup); #include 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) { diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 309a173c821d2..166002b12674e 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c @@ -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; diff --git a/include/asm-i386/hpet.h b/include/asm-i386/hpet.h index 8890ea1fdb4eb..ffc472ff54183 100644 --- a/include/asm-i386/hpet.h +++ b/include/asm-i386/hpet.h @@ -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 */ diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 27c38b2407360..e1aaf1fac8e0e 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h @@ -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__ */ -- 2.53.0