Skip to content

Commit

Permalink
rtc: stop warning for invalid alarms when the alarm is disabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexandre Belloni committed Sep 5, 2023
1 parent 7130856 commit 348c11a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
err = rtc_valid_tm(&alarm->time);

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

Expand Down

0 comments on commit 348c11a

Please sign in to comment.