提交 1735be4b 编写于 作者: A Alexander Shiyan 提交者: Linus Torvalds

drivers/rtc/rtc-ds1742.c: report to RTC core if retrieved time is invalid

Let RTC core decide if the retrieved time is invalid, instead of
processing errors in the driver.
Signed-off-by: NAlexander Shiyan <shc_work@mail.ru>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 2cbc2187
......@@ -115,11 +115,7 @@ static int ds1742_rtc_read_time(struct device *dev, struct rtc_time *tm)
/* year is 1900 + tm->tm_year */
tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900;
if (rtc_valid_tm(tm) < 0) {
dev_err(dev, "retrieved date/time is not valid.\n");
rtc_time_to_tm(0, tm);
}
return 0;
return rtc_valid_tm(tm);
}
static const struct rtc_class_ops ds1742_rtc_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册