rtc: ds1305: Report maximum alarm limit to rtc core
authorGuenter Roeck <linux@roeck-us.net>
Thu, 17 Aug 2023 22:55:36 +0000 (15:55 -0700)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 27 Aug 2023 21:50:22 +0000 (23:50 +0200)
commit46b79ac0b463e155b098805ff66f1f22ff249b45
tree0c93852aa3d956eaa9c66aff7f9b573521c09b57
parent3637bbdc8a446b8edb369383d2abc816c96ee864
rtc: ds1305: Report maximum alarm limit to rtc core

DS1305 only supports alarms up to 24 hours in the future.
Report the limit to the RTC core, and use the reported limit
to validate the requested alarm time when setting it.

If the alarm is too large when trying to set an alarm, return -ERANGE
instead of -EDOM to align with error codes returned by other rtc drivers.

Cc: Brian Norris <briannorris@chromium.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230817225537.4053865-7-linux@roeck-us.net
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ds1305.c