diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-09-11 17:24:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:58:58 -0400 |
commit | 1735be4b822e8e3808f461372ff3942824790172 (patch) | |
tree | 8600335734c78fd2560b54bc23983bd692cfd5ac /drivers/rtc/rtc-ds1742.c | |
parent | 2cbc21877adf6adc69ca1fbc5fd1edbd7e1e3c59 (diff) |
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 <shc_work@mail.ru>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-ds1742.c')
-rw-r--r-- | drivers/rtc/rtc-ds1742.c | 6 |
1 files changed, 1 insertions, 5 deletions
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) | |||
115 | /* year is 1900 + tm->tm_year */ | 115 | /* year is 1900 + tm->tm_year */ |
116 | tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900; | 116 | tm->tm_year = bcd2bin(year) + bcd2bin(century) * 100 - 1900; |
117 | 117 | ||
118 | if (rtc_valid_tm(tm) < 0) { | 118 | return rtc_valid_tm(tm); |
119 | dev_err(dev, "retrieved date/time is not valid.\n"); | ||
120 | rtc_time_to_tm(0, tm); | ||
121 | } | ||
122 | return 0; | ||
123 | } | 119 | } |
124 | 120 | ||
125 | static const struct rtc_class_ops ds1742_rtc_ops = { | 121 | static const struct rtc_class_ops ds1742_rtc_ops = { |