Commit 56928c85 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[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.
parent b465fc74
......@@ -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---
......
......@@ -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) {
......
......@@ -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;
......
......@@ -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 */
......@@ -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__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment