rtc: ds1305: set range
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Fri, 6 Mar 2020 07:34:58 +0000 (08:34 +0100)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 16 Mar 2020 10:12:10 +0000 (11:12 +0100)
The ds1305 is a BCD rtc valid from 2000 to 2099.

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

index 4420fbf..ca55eba 100644 (file)
@@ -694,6 +694,8 @@ static int ds1305_probe(struct spi_device *spi)
                return PTR_ERR(ds1305->rtc);
 
        ds1305->rtc->ops = &ds1305_ops;
+       ds1305->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
+       ds1305->rtc->range_max = RTC_TIMESTAMP_END_2099;
 
        ds1305_nvmem_cfg.priv = ds1305;
        ds1305->rtc->nvram_old_abi = true;