aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-03-24 07:46:23 -0400
committerThomas Gleixner <tglx@linutronix.de>2012-03-24 07:46:23 -0400
commitc5e14e763046b11dd8bf57b5dc9f3ab444af8e60 (patch)
tree8f3c68218ef4ffadeb5c0620b9d2fe6e1fd17281 /kernel
parent68fe7b23d559763a2e19e5fc1cf7036e4aaecb10 (diff)
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: Ingo Molnar <mingo@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/alarmtimer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index c16548807f1e..8a538c55fc7b 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -46,10 +46,9 @@ static struct alarm_base {
46static ktime_t freezer_delta; 46static ktime_t freezer_delta;
47static DEFINE_SPINLOCK(freezer_delta_lock); 47static DEFINE_SPINLOCK(freezer_delta_lock);
48 48
49static struct rtc_timer rtctimer;
50
51#ifdef CONFIG_RTC_CLASS 49#ifdef CONFIG_RTC_CLASS
52/* rtc timer and device for setting alarm wakeups at suspend */ 50/* rtc timer and device for setting alarm wakeups at suspend */
51static struct rtc_timer rtctimer;
53static struct rtc_device *rtcdev; 52static struct rtc_device *rtcdev;
54static DEFINE_SPINLOCK(rtcdev_lock); 53static DEFINE_SPINLOCK(rtcdev_lock);
55 54
@@ -97,6 +96,11 @@ static int alarmtimer_rtc_add_device(struct device *dev,
97 return 0; 96 return 0;
98} 97}
99 98
99static inline void alarmtimer_rtc_timer_init(void)
100{
101 rtc_timer_init(&rtctimer, NULL, NULL);
102}
103
100static struct class_interface alarmtimer_rtc_interface = { 104static struct class_interface alarmtimer_rtc_interface = {
101 .add_dev = &alarmtimer_rtc_add_device, 105 .add_dev = &alarmtimer_rtc_add_device,
102}; 106};
@@ -118,6 +122,7 @@ static inline struct rtc_device *alarmtimer_get_rtcdev(void)
118#define rtcdev (NULL) 122#define rtcdev (NULL)
119static inline int alarmtimer_rtc_interface_setup(void) { return 0; } 123static inline int alarmtimer_rtc_interface_setup(void) { return 0; }
120static inline void alarmtimer_rtc_interface_remove(void) { } 124static inline void alarmtimer_rtc_interface_remove(void) { }
125static inline void alarmtimer_rtc_timer_init(void) { }
121#endif 126#endif
122 127
123/** 128/**
@@ -784,7 +789,7 @@ static int __init alarmtimer_init(void)
784 .nsleep = alarm_timer_nsleep, 789 .nsleep = alarm_timer_nsleep,
785 }; 790 };
786 791
787 rtc_timer_init(&rtctimer, NULL, NULL); 792 alarmtimer_rtc_timer_init();
788 793
789 posix_timers_register_clock(CLOCK_REALTIME_ALARM, &alarm_clock); 794 posix_timers_register_clock(CLOCK_REALTIME_ALARM, &alarm_clock);
790 posix_timers_register_clock(CLOCK_BOOTTIME_ALARM, &alarm_clock); 795 posix_timers_register_clock(CLOCK_BOOTTIME_ALARM, &alarm_clock);