From: Alexander Shiyan Date: Wed, 11 Sep 2013 21:24:26 +0000 (-0700) Subject: drivers/rtc/rtc-ds1742.c: report to RTC core if retrieved time is invalid X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1735be4b822e8e3808f461372ff3942824790172;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Alexander Shiyan Cc: Jingoo Han Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-ds1742.c b/drivers/rtc/rtc-ds1742.c index 139934ff14fc..17b73fdc3b6e 100644 --- a/drivers/rtc/rtc-ds1742.c +++ b/drivers/rtc/rtc-ds1742.c @@ -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 = {