Commit c5e14e76 authored by Thomas Gleixner's avatar Thomas Gleixner

alarmtimer: Don't call rtc_timer_init() when CONFIG_RTC_CLASS=n

rtc_timer_init() is not available when CONFIG_RTC_CLASS=n. Provide a
proper wrapper in the RTC section of alarmtimer.c
Reported-by: default avatarIngo Molnar <mingo@kernel.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
parent 68fe7b23
...@@ -46,10 +46,9 @@ static struct alarm_base { ...@@ -46,10 +46,9 @@ static struct alarm_base {
static ktime_t freezer_delta; static ktime_t freezer_delta;
static DEFINE_SPINLOCK(freezer_delta_lock); static DEFINE_SPINLOCK(freezer_delta_lock);
static struct rtc_timer rtctimer;
#ifdef CONFIG_RTC_CLASS #ifdef CONFIG_RTC_CLASS
/* rtc timer and device for setting alarm wakeups at suspend */ /* rtc timer and device for setting alarm wakeups at suspend */
static struct rtc_timer rtctimer;
static struct rtc_device *rtcdev; static struct rtc_device *rtcdev;
static DEFINE_SPINLOCK(rtcdev_lock); static DEFINE_SPINLOCK(rtcdev_lock);
...@@ -97,6 +96,11 @@ static int alarmtimer_rtc_add_device(struct device *dev, ...@@ -97,6 +96,11 @@ static int alarmtimer_rtc_add_device(struct device *dev,
return 0; return 0;
} }
static inline void alarmtimer_rtc_timer_init(void)
{
rtc_timer_init(&rtctimer, NULL, NULL);
}
static struct class_interface alarmtimer_rtc_interface = { static struct class_interface alarmtimer_rtc_interface = {
.add_dev = &alarmtimer_rtc_add_device, .add_dev = &alarmtimer_rtc_add_device,
}; };
...@@ -118,6 +122,7 @@ static inline struct rtc_device *alarmtimer_get_rtcdev(void) ...@@ -118,6 +122,7 @@ static inline struct rtc_device *alarmtimer_get_rtcdev(void)
#define rtcdev (NULL) #define rtcdev (NULL)
static inline int alarmtimer_rtc_interface_setup(void) { return 0; } static inline int alarmtimer_rtc_interface_setup(void) { return 0; }
static inline void alarmtimer_rtc_interface_remove(void) { } static inline void alarmtimer_rtc_interface_remove(void) { }
static inline void alarmtimer_rtc_timer_init(void) { }
#endif #endif
/** /**
...@@ -784,7 +789,7 @@ static int __init alarmtimer_init(void) ...@@ -784,7 +789,7 @@ static int __init alarmtimer_init(void)
.nsleep = alarm_timer_nsleep, .nsleep = alarm_timer_nsleep,
}; };
rtc_timer_init(&rtctimer, NULL, NULL); alarmtimer_rtc_timer_init();
posix_timers_register_clock(CLOCK_REALTIME_ALARM, &alarm_clock); posix_timers_register_clock(CLOCK_REALTIME_ALARM, &alarm_clock);
posix_timers_register_clock(CLOCK_BOOTTIME_ALARM, &alarm_clock); posix_timers_register_clock(CLOCK_BOOTTIME_ALARM, &alarm_clock);
......
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