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>
This commit is contained in:
parent
02f826830f
commit
8aeda692f6
|
@ -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);
|
||||
device_initcall(abracon_init);
|
||||
|
|
Loading…
Reference in New Issue