Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: rs5c348: let the core handle invalid time

Returning a valid time when the time is invalid is a bad practice, because
then userspace is not able to react on the information. Also, it doesn't
make sense to return epoch because it is already the default time.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

-5
-5
drivers/rtc/rtc-rs5c348.c
··· 135 135 tm->tm_year = bcd2bin(rxbuf[RS5C348_REG_YEAR]) + 136 136 ((rxbuf[RS5C348_REG_MONTH] & RS5C348_BIT_Y2K) ? 100 : 0); 137 137 138 - if (rtc_valid_tm(tm) < 0) { 139 - dev_err(&spi->dev, "retrieved date/time is not valid.\n"); 140 - rtc_time_to_tm(0, tm); 141 - } 142 - 143 138 return 0; 144 139 } 145 140