summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-pcf85063.c
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-04-01 18:08:09 +0200
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-04-04 10:07:11 +0200
commit802a779aeb662fadc0012aafba1da111debc623d (patch)
tree6cf77adc9902c6e0a679e47a8aec3a2b9e9be09f /drivers/rtc/rtc-pcf85063.c
parent3555a3425822601ea16a3508b803fa7c1158cba0 (diff)
downloadlwn-802a779aeb662fadc0012aafba1da111debc623d.tar.gz
lwn-802a779aeb662fadc0012aafba1da111debc623d.zip
rtc: pcf85063: set range
This is a standard BCD RTC that will fail in 2100. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-pcf85063.c')
-rw-r--r--drivers/rtc/rtc-pcf85063.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
index 7736bf99d57a..550d2e74d5bf 100644
--- a/drivers/rtc/rtc-pcf85063.c
+++ b/drivers/rtc/rtc-pcf85063.c
@@ -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);
}