diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2018-07-07 23:39:11 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-07-19 17:03:36 -0400 |
commit | 992c1db45591b891935a6da5c3f14d8af5def05b (patch) | |
tree | 17a27182e132e737035202d4514905d6255a1ffe /drivers/rtc/i2c_rtc_emul.c | |
parent | 0938cff73727f562cd49c55e1d47d09bbffd4915 (diff) |
drivers: rtc: resolve year 2038 problem in rtc_to_tm
Our implementation of rtc_to_tm() cannot handle dates of more than
0x7fffffff seconds after 1970-01-01.
Adopt the Linux kernel implementation.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'drivers/rtc/i2c_rtc_emul.c')
-rw-r--r-- | drivers/rtc/i2c_rtc_emul.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/rtc/i2c_rtc_emul.c b/drivers/rtc/i2c_rtc_emul.c index bad61c377f..d4b33e59d6 100644 --- a/drivers/rtc/i2c_rtc_emul.c +++ b/drivers/rtc/i2c_rtc_emul.c @@ -96,7 +96,9 @@ static int sandbox_i2c_rtc_get(struct udevice *dev, struct rtc_time *time) now = plat->base_time; } - return rtc_to_tm(now + plat->offset, time); + rtc_to_tm(now + plat->offset, time); + + return 0; } static int sandbox_i2c_rtc_set(struct udevice *dev, const struct rtc_time *time) |