rtc: pcf85063: set range
authorAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 1 Apr 2019 16:08:09 +0000 (18:08 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Thu, 4 Apr 2019 08:07:11 +0000 (10:07 +0200)
This is a standard BCD RTC that will fail in 2100.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-pcf85063.c

index 7736bf99d57a98b5a1c93d8e793ae97a6030656e..550d2e74d5bf1008ab71b821280425599b237082 100644 (file)
@@ -113,9 +113,6 @@ static int pcf85063_rtc_set_time(struct device *dev, struct rtc_time *tm)
        u8 regs[7];
        u8 ctrl1;
 
-       if ((tm->tm_year < 100) || (tm->tm_year > 199))
-               return -EINVAL;
-
        /*
         * to accurately set the time, reset the divider chain and keep it in
         * reset state until all time/date registers are written
@@ -223,6 +220,8 @@ static int pcf85063_probe(struct i2c_client *client)
                return PTR_ERR(rtc);
 
        rtc->ops = &pcf85063_rtc_ops;
+       rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
+       rtc->range_max = RTC_TIMESTAMP_END_2099;
 
        return rtc_register_device(rtc);
 }