]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rtc: m48t59: set range
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 11 Sep 2024 22:48:36 +0000 (00:48 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sat, 21 Sep 2024 23:17:10 +0000 (01:17 +0200)
The m48t59 leap year calculation will fail in 2100

Link: https://lore.kernel.org/r/20240911224836.1571831-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-m48t59.c

index cd2ca49805d8a24e3c7ba68769a8d4b88ab6cc55..5d30ce8e13ca0368c69b50660ff669f8edad6d59 100644 (file)
@@ -458,6 +458,8 @@ static int m48t59_rtc_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, m48t59);
 
        m48t59->rtc->ops = &m48t59_rtc_ops;
+       m48t59->rtc->range_min = RTC_TIMESTAMP_BEGIN_1900;
+       m48t59->rtc->range_max = RTC_TIMESTAMP_END_2099;
 
        nvmem_cfg.size = pdata->offset;
        ret = devm_rtc_nvmem_register(m48t59->rtc, &nvmem_cfg);