9
0
Fork 0

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:
Andrey Smirnov 2016-04-03 18:06:31 -07:00 committed by Sascha Hauer
parent 02f826830f
commit 8aeda692f6
1 changed files with 2 additions and 2 deletions

View File

@ -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);