Skip to content

Commit 348c11a

Browse files
rtc: stop warning for invalid alarms when the alarm is disabled
When the alarm is not enabled, it may never have been set and so we can't expect it to be valid. This will prevent the apparition of boot messages like this one: rtc rtc0: invalid alarm value: 2023-7-8 45:85:85 Link: https://lore.kernel.org/r/20230827221532.543353-1-alexandre.belloni@bootlin.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 7130856 commit 348c11a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/rtc/interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
376376
err = rtc_valid_tm(&alarm->time);
377377

378378
done:
379-
if (err)
379+
if (err && alarm->enabled)
380380
dev_warn(&rtc->dev, "invalid alarm value: %ptR\n",
381381
&alarm->time);
382382

0 commit comments

Comments
 (0)