We don't need to check the time range manually in set_time(), we can
use range_min and range_max exposed by struct rtc_device.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200914154601.32245-15-brgl@bgdev.pl
u8 date[RX8010_YEAR - RX8010_SEC + 1];
int err;
- if ((dt->tm_year < 100) || (dt->tm_year > 199))
- return -EINVAL;
-
/* set STOP bit before changing clock/calendar */
err = regmap_set_bits(rx8010->regs, RX8010_CTRL, RX8010_CTRL_STOP);
if (err)
}
rx8010->rtc->max_user_freq = 1;
+ rx8010->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
+ rx8010->rtc->range_max = RTC_TIMESTAMP_END_2099;
return rtc_register_device(rx8010->rtc);
}