rtc: ensure rtc_set_alarm fails when alarms are not supported
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 5 Jun 2018 21:09:14 +0000 (23:09 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 7 Jun 2018 18:09:49 +0000 (20:09 +0200)
commitabfdff44bc38e9e2ef7929f633fb8462632299d4
tree0ac2c1257f51bc418edf8b28b3ca2efdd48ae98c
parent1928906d126f647ff025a54df4ed88c05b2afba9
rtc: ensure rtc_set_alarm fails when alarms are not supported

When using RTC_ALM_SET or RTC_WKALM_SET with rtc_wkalrm.enabled not set,
rtc_timer_enqueue() is not called and rtc_set_alarm() may succeed but the
subsequent RTC_AIE_ON ioctl will fail. RTC_ALM_READ would also fail in that
case.

Ensure rtc_set_alarm() fails when alarms are not supported to avoid letting
programs think the alarms are working for a particular RTC when they are
not.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/interface.c