Skip to content

Commit b242650

Browse files
rtc: m48t59: set range
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>
1 parent 4015580 commit b242650

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/rtc/rtc-m48t59.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,8 @@ static int m48t59_rtc_probe(struct platform_device *pdev)
458458
platform_set_drvdata(pdev, m48t59);
459459

460460
m48t59->rtc->ops = &m48t59_rtc_ops;
461+
m48t59->rtc->range_min = RTC_TIMESTAMP_BEGIN_1900;
462+
m48t59->rtc->range_max = RTC_TIMESTAMP_END_2099;
461463

462464
nvmem_cfg.size = pdata->offset;
463465
ret = devm_rtc_nvmem_register(m48t59->rtc, &nvmem_cfg);

0 commit comments

Comments
 (0)