aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/interface.c
diff options
context:
space:
mode:
authorAlexandre Belloni <[email protected]>2023-02-14 22:27:53 +0000
committerAlexandre Belloni <[email protected]>2023-02-22 11:32:05 +0000
commita783c962619271a8b905efad1d89adfec11ae0c8 (patch)
tree2b51d546f0d83490d948907c13528fb63d142e85 /drivers/rtc/interface.c
parentrtc: rv3032: add ACPI support (diff)
downloadkernel-a783c962619271a8b905efad1d89adfec11ae0c8.tar.gz
kernel-a783c962619271a8b905efad1d89adfec11ae0c8.zip
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 <[email protected]> Reported-by: Marcel Ziswiler <[email protected]> Fixes: 7ae41220ef58 ("rtc: introduce features bitfield") Tested-by: Philippe Schenker <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r--drivers/rtc/interface.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 7c30cb3c764d..499d89150afc 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -392,7 +392,7 @@ int rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
return err;
if (!rtc->ops) {
err = -ENODEV;
- } else if (!test_bit(RTC_FEATURE_ALARM, rtc->features) || !rtc->ops->read_alarm) {
+ } else if (!test_bit(RTC_FEATURE_ALARM, rtc->features)) {
err = -EINVAL;
} else {
memset(alarm, 0, sizeof(struct rtc_wkalrm));