aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2011-04-29 18:03:10 -0400
committerThomas Gleixner <tglx@linutronix.de>2011-05-02 15:36:57 -0400
commit472647dcd7e351dbeda750e5ab3e8f7b06d1199a (patch)
tree536842fa33d135d4b18e6d1dd5cf573a5b53719c /kernel/time
parent7068b7a16270f1e85a8893d74b0f3c58d7826883 (diff)
timers: Fix alarmtimer build issues when CONFIG_RTC_CLASS=n
Ingo pointed out that the alarmtimers won't build if CONFIG_RTC_CLASS=n. This patch adds proper ifdefs to the alarmtimer code to disable the rtc usage if it is not built in. Reported-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/alarmtimer.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 491e37b8de1f..9265014cb4db 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -42,9 +42,11 @@ static struct alarm_base {
42 clockid_t base_clockid; 42 clockid_t base_clockid;
43} alarm_bases[ALARM_NUMTYPE]; 43} alarm_bases[ALARM_NUMTYPE];
44 44
45#ifdef CONFIG_RTC_CLASS
45/* rtc timer and device for setting alarm wakeups at suspend */ 46/* rtc timer and device for setting alarm wakeups at suspend */
46static struct rtc_timer rtctimer; 47static struct rtc_timer rtctimer;
47static struct rtc_device *rtcdev; 48static struct rtc_device *rtcdev;
49#endif
48 50
49/* freezer delta & lock used to handle clock_nanosleep triggered wakeups */ 51/* freezer delta & lock used to handle clock_nanosleep triggered wakeups */
50static ktime_t freezer_delta; 52static ktime_t freezer_delta;
@@ -148,7 +150,7 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer)
148 150
149} 151}
150 152
151 153#ifdef CONFIG_RTC_CLASS
152/** 154/**
153 * alarmtimer_suspend - Suspend time callback 155 * alarmtimer_suspend - Suspend time callback
154 * @dev: unused 156 * @dev: unused
@@ -206,7 +208,12 @@ static int alarmtimer_suspend(struct device *dev)
206 208
207 return 0; 209 return 0;
208} 210}
209 211#else
212static int alarmtimer_suspend(struct device *dev)
213{
214 return 0;
215}
216#endif
210 217
211static void alarmtimer_freezerset(ktime_t absexp, enum alarmtimer_type type) 218static void alarmtimer_freezerset(ktime_t absexp, enum alarmtimer_type type)
212{ 219{
@@ -631,6 +638,7 @@ static int __init alarmtimer_init(void)
631} 638}
632device_initcall(alarmtimer_init); 639device_initcall(alarmtimer_init);
633 640
641#ifdef CONFIG_RTC_CLASS
634/** 642/**
635 * has_wakealarm - check rtc device has wakealarm ability 643 * has_wakealarm - check rtc device has wakealarm ability
636 * @dev: current device 644 * @dev: current device
@@ -675,4 +683,12 @@ static int __init alarmtimer_init_late(void)
675 683
676 return 0; 684 return 0;
677} 685}
686#else
687static int __init alarmtimer_init_late(void)
688{
689 printk(KERN_WARNING "Kernel not built with RTC support, ALARM timers"
690 " will not wake from suspend");
691 return 0;
692}
693#endif
678late_initcall(alarmtimer_init_late); 694late_initcall(alarmtimer_init_late);