Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bff11e3a authored by Alexandre Belloni's avatar Alexandre Belloni
Browse files

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: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 812318a0
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -135,11 +135,6 @@ rs5c348_rtc_read_time(struct device *dev, struct rtc_time *tm)
	tm->tm_year = bcd2bin(rxbuf[RS5C348_REG_YEAR]) +
	tm->tm_year = bcd2bin(rxbuf[RS5C348_REG_YEAR]) +
		((rxbuf[RS5C348_REG_MONTH] & RS5C348_BIT_Y2K) ? 100 : 0);
		((rxbuf[RS5C348_REG_MONTH] & RS5C348_BIT_Y2K) ? 100 : 0);


	if (rtc_valid_tm(tm) < 0) {
		dev_err(&spi->dev, "retrieved date/time is not valid.\n");
		rtc_time_to_tm(0, tm);
	}

	return 0;
	return 0;
}
}