aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@bootlin.com>2019-03-04 05:03:46 -0500
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2019-03-04 14:21:19 -0500
commit2e17f8b982c38719b3e19e33ef85e8188df7cfd0 (patch)
tree5ee26c8fbfd242de3b929298c7b180294af4d44c /drivers/rtc
parent1a9de2100d1c3ef7cb685845726438767e44c24e (diff)
rtc: rv8803: let the core handle range
Let the core handle the RTC range instead of open coding it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-rv8803.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c
index 450a0b831a2d..df000a68d6b1 100644
--- a/drivers/rtc/rtc-rv8803.c
+++ b/drivers/rtc/rtc-rv8803.c
@@ -236,9 +236,6 @@ static int rv8803_set_time(struct device *dev, struct rtc_time *tm)
236 u8 date[7]; 236 u8 date[7];
237 int ctrl, flags, ret; 237 int ctrl, flags, ret;
238 238
239 if ((tm->tm_year < 100) || (tm->tm_year > 199))
240 return -EINVAL;
241
242 ctrl = rv8803_read_reg(rv8803->client, RV8803_CTRL); 239 ctrl = rv8803_read_reg(rv8803->client, RV8803_CTRL);
243 if (ctrl < 0) 240 if (ctrl < 0)
244 return ctrl; 241 return ctrl;
@@ -602,6 +599,8 @@ static int rv8803_probe(struct i2c_client *client,
602 599
603 rv8803->rtc->ops = &rv8803_rtc_ops; 600 rv8803->rtc->ops = &rv8803_rtc_ops;
604 rv8803->rtc->nvram_old_abi = true; 601 rv8803->rtc->nvram_old_abi = true;
602 rv8803->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
603 rv8803->rtc->range_max = RTC_TIMESTAMP_END_2099;
605 err = rtc_register_device(rv8803->rtc); 604 err = rtc_register_device(rv8803->rtc);
606 if (err) 605 if (err)
607 return err; 606 return err;