]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
alarmtimer: Make sure we initialize the rtctimer
authorJohn Stultz <john.stultz@linaro.org>
Fri, 23 Mar 2012 22:52:25 +0000 (15:52 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Fri, 23 Mar 2012 23:23:12 +0000 (16:23 -0700)
jonghwan Choi reported seeing warnings with the alarmtimer
code at suspend/resume time, and pointed out that the
rtctimer isn't being properly initialized.

This patch corrects this issue.

Reported-by: jonghwan Choi <jhbird.choi@gmail.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
kernel/time/alarmtimer.c

index 8a46f5d64504f15dcaf31ec4f5fcee7ea15a8bdf..c16548807f1e1fad9628b1fc3678601e71c6f774 100644 (file)
@@ -46,9 +46,10 @@ static struct alarm_base {
 static ktime_t freezer_delta;
 static DEFINE_SPINLOCK(freezer_delta_lock);
 
+static struct rtc_timer                rtctimer;
+
 #ifdef CONFIG_RTC_CLASS
 /* rtc timer and device for setting alarm wakeups at suspend */
-static struct rtc_timer                rtctimer;
 static struct rtc_device       *rtcdev;
 static DEFINE_SPINLOCK(rtcdev_lock);
 
@@ -783,6 +784,8 @@ static int __init alarmtimer_init(void)
                .nsleep         = alarm_timer_nsleep,
        };
 
+       rtc_timer_init(&rtctimer, NULL, NULL);
+
        posix_timers_register_clock(CLOCK_REALTIME_ALARM, &alarm_clock);
        posix_timers_register_clock(CLOCK_BOOTTIME_ALARM, &alarm_clock);