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 -puN arch/i386/Kconfig~get_rtc_time-fix arch/i386/Kconfig --- 25/arch/i386/Kconfig~get_rtc_time-fix 2003-09-01 01:18:46.000000000 -0700 +++ 25-akpm/arch/i386/Kconfig 2003-09-01 01:27:54.000000000 -0700 @@ -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 -puN arch/i386/kernel/time_hpet.c~get_rtc_time-fix arch/i386/kernel/time_hpet.c --- 25/arch/i386/kernel/time_hpet.c~get_rtc_time-fix 2003-09-01 01:18:46.000000000 -0700 +++ 25-akpm/arch/i386/kernel/time_hpet.c 2003-09-01 01:18:46.000000000 -0700 @@ -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, 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 -puN drivers/char/rtc.c~get_rtc_time-fix drivers/char/rtc.c --- 25/drivers/char/rtc.c~get_rtc_time-fix 2003-09-01 01:18:46.000000000 -0700 +++ 25-akpm/drivers/char/rtc.c 2003-09-01 01:18:46.000000000 -0700 @@ -137,7 +137,6 @@ static int rtc_ioctl(struct inode *inode 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 } 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_updat 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 -puN include/asm-i386/hpet.h~get_rtc_time-fix include/asm-i386/hpet.h --- 25/include/asm-i386/hpet.h~get_rtc_time-fix 2003-09-01 01:18:46.000000000 -0700 +++ 25-akpm/include/asm-i386/hpet.h 2003-09-01 01:18:46.000000000 -0700 @@ -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(unsign 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 -puN include/linux/rtc.h~get_rtc_time-fix include/linux/rtc.h --- 25/include/linux/rtc.h~get_rtc_time-fix 2003-09-01 01:18:46.000000000 -0700 +++ 25-akpm/include/linux/rtc.h 2003-09-01 01:18:46.000000000 -0700 @@ -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__ */ _