rtc: rtc_update_irq_enable: rework UIE emulation
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 18 Apr 2021 00:00:23 +0000 (02:00 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 29 Apr 2021 21:04:13 +0000 (23:04 +0200)
commitc55c3a516ceff3a041d5e3253d4d9a1b75fbb1d8
treed7b7cfbc657802e2c71d0e79adc8111ef6540ce1
parent4bf84b449a0ea3885397bb5540a8fc68a78edb9d
rtc: rtc_update_irq_enable: rework UIE emulation

Now that the core is aware of whether alarms are available, it is possible
to decide whether UIE emulation is required before actually trying to set
the alarm.

This greatly simplifies rtc_update_irq_enable because there is now only one
error value to track and is not relying on the return value of
__rtc_set_alarm anymore.

Tested-by: Ɓukasz Stelmach <l.stelmach@samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210418000023.995758-3-alexandre.belloni@bootlin.com
drivers/rtc/interface.c