From: Alexandre Belloni Date: Wed, 9 Mar 2022 16:22:50 +0000 (+0100) Subject: rtc: spear: set range X-Git-Tag: v5.18-rc1~36^2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f395e1d3b28d7c2c67b73bd467c4fb79523e1c65;p=thirdparty%2Flinux.git rtc: spear: set range While the RTC can store dates from year 0000 to 9999, leap years where not tested fro 2100. The driver currently stores tm_year directly which will probably fail at that time or more probably in 2300. Signed-off-by: Alexandre Belloni Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20220309162301.61679-19-alexandre.belloni@bootlin.com --- diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c index 1b40380aaba27..e386bd714b526 100644 --- a/drivers/rtc/rtc-spear.c +++ b/drivers/rtc/rtc-spear.c @@ -385,6 +385,8 @@ static int spear_rtc_probe(struct platform_device *pdev) platform_set_drvdata(pdev, config); config->rtc->ops = &spear_rtc_ops; + config->rtc->range_min = RTC_TIMESTAMP_BEGIN_0000; + config->rtc->range_min = RTC_TIMESTAMP_END_9999; config->rtc->uie_unsupported = 1; status = devm_rtc_register_device(config->rtc);