summaryrefslogtreecommitdiff
path: root/drivers/rtc/i2c_rtc_emul.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-07-08 00:39:11 +0300
committerTom Rini <trini@konsulko.com>2018-07-20 00:03:36 +0300
commit992c1db45591b891935a6da5c3f14d8af5def05b (patch)
tree17a27182e132e737035202d4514905d6255a1ffe /drivers/rtc/i2c_rtc_emul.c
parent0938cff73727f562cd49c55e1d47d09bbffd4915 (diff)
downloadu-boot-992c1db45591b891935a6da5c3f14d8af5def05b.tar.xz
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.c4
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)