提交 ad30dfa9 编写于 作者: J John Stultz

alarmtimer: Make sure we initialize the rtctimer

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: Njonghwan Choi <jhbird.choi@gmail.com>
Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
上级 6b43ae8a
...@@ -46,9 +46,10 @@ static struct alarm_base { ...@@ -46,9 +46,10 @@ 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);
...@@ -783,6 +784,8 @@ static int __init alarmtimer_init(void) ...@@ -783,6 +784,8 @@ static int __init alarmtimer_init(void)
.nsleep = alarm_timer_nsleep, .nsleep = alarm_timer_nsleep,
}; };
rtc_timer_init(&rtctimer, NULL, NULL);
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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册