]> git.baikalelectronics.ru Git - kernel.git/commit
alarmtimer: Check RTC features instead of ops
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 11 May 2021 01:45:16 +0000 (03:45 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 11 May 2021 19:28:04 +0000 (21:28 +0200)
commit61fb3bc1b42a658c3ed41ced92841c067a627315
tree6e00548e382a36961740da2374e8ada39aeb45de
parent78f0a5f86683713bf30eae653c023ab078a37264
alarmtimer: Check RTC features instead of ops

RTC drivers used to leave .set_alarm() NULL in order to signal the RTC
device doesn't support alarms. The drivers are now clearing the
RTC_FEATURE_ALARM bit for that purpose in order to keep the rtc_class_ops
structure const. So now, .set_alarm() is set unconditionally and this
possibly causes the alarmtimer code to select an RTC device that doesn't
support alarms.

Test RTC_FEATURE_ALARM instead of relying on ops->set_alarm to determine
whether alarms are available.

Fixes: fa6a86aa7be4 ("rtc: introduce features bitfield")
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210511014516.563031-1-alexandre.belloni@bootlin.com
kernel/time/alarmtimer.c