1
0
Fork 0

rtc: ab-b5ze-s3: stop validating rtc_time in .read_time

The RTC core is always calling rtc_valid_tm after the read_time callback.
It is not necessary to call it just before returning from the callback.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
hifive-unleashed-5.1
Alexandre Belloni 2018-02-19 16:23:54 +01:00
parent 22652ba724
commit ce2e5a7613
1 changed files with 1 additions and 3 deletions

View File

@ -217,7 +217,7 @@ static int _abb5zes3_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
struct abb5zes3_rtc_data *data = dev_get_drvdata(dev);
u8 regs[ABB5ZES3_REG_RTC_SC + ABB5ZES3_RTC_SEC_LEN];
int ret;
int ret = 0;
/*
* As we need to read CTRL1 register anyway to access 24/12h
@ -255,8 +255,6 @@ static int _abb5zes3_rtc_read_time(struct device *dev, struct rtc_time *tm)
tm->tm_mon = bcd2bin(regs[ABB5ZES3_REG_RTC_MO]) - 1; /* starts at 1 */
tm->tm_year = bcd2bin(regs[ABB5ZES3_REG_RTC_YR]) + 100;
ret = rtc_valid_tm(tm);
err:
return ret;
}