Skip to content

Commit a783c96

Browse files
rtc: allow rtc_read_alarm without read_alarm callback
.read_alarm is not necessary to read the current alarm because it is recorded in the aie_timer and so rtc_read_alarm() will never call rtc_read_alarm_internal() which is the only function calling the callback. Reported-by: Zhipeng Wang <zhipeng.wang_1@nxp.com> Reported-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Fixes: 7ae4122 ("rtc: introduce features bitfield") Tested-by: Philippe Schenker <philippe.schenker@toradex.com> Link: https://lore.kernel.org/r/20230214222754.582582-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 2d433e9 commit a783c96

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/rtc/interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
392392
return err;
393393
if (!rtc->ops) {
394394
err = -ENODEV;
395-
} else if (!test_bit(RTC_FEATURE_ALARM, rtc->features) || !rtc->ops->read_alarm) {
395+
} else if (!test_bit(RTC_FEATURE_ALARM, rtc->features)) {
396396
err = -EINVAL;
397397
} else {
398398
memset(alarm, 0, sizeof(struct rtc_wkalrm));

0 commit comments

Comments
 (0)