rtc: rv8803: invalidate date/time if alarm time is invalid
RTC core never calls rv8803_set_alarm with an invalid alarm time, so if an invalid alarm time > 0 is set, external factors must have corrupted the RTC's alarm time and possibly other registers. Play it safe by marking the date/time invalid, so all registers are reinitialized on a ->set_time. This may cause existing setups to lose time if they so far set only date/time, but ignored that the alarm registers had an invalid date value, e.g.: rtc rtc0: invalid alarm value: 2020-3-27 7:82:0 These systems will have their ->get_time return -EINVAL till ->set_time initializes the alarm value (and sets a new time). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20221123095527.2771434-3-s.hauer@pengutronix.deSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Showing
Please register or sign in to comment