Commit 2e17f8b9 authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: rv8803: let the core handle range

Let the core handle the RTC range instead of open coding it.
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 1a9de210
...@@ -236,9 +236,6 @@ static int rv8803_set_time(struct device *dev, struct rtc_time *tm) ...@@ -236,9 +236,6 @@ static int rv8803_set_time(struct device *dev, struct rtc_time *tm)
u8 date[7]; u8 date[7];
int ctrl, flags, ret; int ctrl, flags, ret;
if ((tm->tm_year < 100) || (tm->tm_year > 199))
return -EINVAL;
ctrl = rv8803_read_reg(rv8803->client, RV8803_CTRL); ctrl = rv8803_read_reg(rv8803->client, RV8803_CTRL);
if (ctrl < 0) if (ctrl < 0)
return ctrl; return ctrl;
...@@ -602,6 +599,8 @@ static int rv8803_probe(struct i2c_client *client, ...@@ -602,6 +599,8 @@ static int rv8803_probe(struct i2c_client *client,
rv8803->rtc->ops = &rv8803_rtc_ops; rv8803->rtc->ops = &rv8803_rtc_ops;
rv8803->rtc->nvram_old_abi = true; rv8803->rtc->nvram_old_abi = true;
rv8803->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
rv8803->rtc->range_max = RTC_TIMESTAMP_END_2099;
err = rtc_register_device(rv8803->rtc); err = rtc_register_device(rv8803->rtc);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment