Skip to contentSkip to conversation

rtc: m48t59: set range

PATCH New [email protected] 1 participant 1 message Sep 11, 2024 Real time clock (RTC)

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 rtc: m48t59: set range

From: Alexandre Belloni <[email protected]>

The m48t59 leap year calculation will fail in 2100

---
 drivers/rtc/rtc-m48t59.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/rtc/rtc-m48t59.c +2 -0
index cd2ca49805d8..5d30ce8e13ca 100644
@@ -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);
Signature · 1 line
2.46.0