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

rtc: stk17ta8: 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>

-4
-4
drivers/rtc/rtc-stk17ta8.c
··· 129 129 /* year is 1900 + tm->tm_year */ 130 130 tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900; 131 131 132 - if (rtc_valid_tm(tm) < 0) { 133 - dev_err(dev, "retrieved date/time is not valid.\n"); 134 - rtc_time_to_tm(0, tm); 135 - } 136 132 return 0; 137 133 } 138 134