summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2023-08-28 00:15:31 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2023-09-06 01:25:15 +0200
commit348c11a7d71b0b216f28ea077137e2351ab0dea8 (patch)
treed4f2faa173ede9b3947ea1f5358c1a44d5cc4b6a /drivers/rtc
parent7130856f56054a031c492d37896cbcbfd04a61b5 (diff)
downloadlwn-348c11a7d71b0b216f28ea077137e2351ab0dea8.tar.gz
lwn-348c11a7d71b0b216f28ea077137e2351ab0dea8.zip
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>
Diffstat (limited to 'drivers/rtc')
-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 499d89150afc..1b63111cdda2 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -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);