diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2016-04-03 18:06:31 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-04-05 08:40:51 +0200 |
commit | 8aeda692f6ee3585f000e4e42129f5dd4aff1441 (patch) | |
tree | b038df5e304716395583cf54d2548ebafc25fbcf /drivers/rtc | |
parent | 02f826830fe0925ef49faaecf001df52ac45726f (diff) | |
download | barebox-8aeda692f6ee3585f000e4e42129f5dd4aff1441.tar.gz barebox-8aeda692f6ee3585f000e4e42129f5dd4aff1441.tar.xz |
rtc: abracon: Check obtained time for validity
Check obtianed time for validity before returning it to the caller
the same way other RTC drivers do.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-abracon.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-abracon.c b/drivers/rtc/rtc-abracon.c index b3af990b9c..02de2f1063 100644 --- a/drivers/rtc/rtc-abracon.c +++ b/drivers/rtc/rtc-abracon.c @@ -59,7 +59,7 @@ static int abracon_get_time(struct rtc_device *rtcdev, struct rtc_time *t) t->tm_mon = bcd2bin(cp[5]); t->tm_year = bcd2bin(cp[6]) + 100; - return 0; + return rtc_valid_tm(t); } static int abracon_set_time(struct rtc_device *rtcdev, struct rtc_time *t) @@ -123,4 +123,4 @@ static int __init abracon_init(void) { return i2c_driver_register(&abracon_driver); } -device_initcall(abracon_init);
\ No newline at end of file +device_initcall(abracon_init); |