Skip to content

Commit

Permalink
alarmtimer: Make sure we initialize the rtctimer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
John Stultz committed Mar 23, 2012
1 parent 6b43ae8 commit ad30dfa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/time/alarmtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit ad30dfa

Please sign in to comment.