Skip to content

Commit

Permalink
rtc: spear: set range
Browse files Browse the repository at this point in the history
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 <alexandre.belloni@bootlin.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20220309162301.61679-19-alexandre.belloni@bootlin.com
  • Loading branch information
alexandrebelloni committed Mar 23, 2022
1 parent 4fc4d33 commit f395e1d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/rtc/rtc-spear.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f395e1d

Please sign in to comment.