diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-07-11 14:47:12 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-07-13 10:47:18 +0200 |
commit | 5089ea15baa9e7b0cb49f36881f2cb27bf281789 (patch) | |
tree | b87b4e9694e371913f58b2e8e37b01a285e703b0 /drivers/rtc/class.c | |
parent | fed0b1bd1b64a680874e8cfa4c3da8dfc01e143f (diff) | |
download | blackbird-op-linux-5089ea15baa9e7b0cb49f36881f2cb27bf281789.tar.gz blackbird-op-linux-5089ea15baa9e7b0cb49f36881f2cb27bf281789.zip |
rtc: use ktime_get_real_ts64() instead of getnstimeofday64()
getnstimeofday64() is just a wrapper around the ktime accessor, so
we should use that directly.
I considered using ktime_get_boottime_ts64() (to avoid leap second
problems) or ktime_get_real_seconds() (to simplify the calculation,
but in the end concluded that the existing interface is probably
the most appropriate in this case.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/class.c')
-rw-r--r-- | drivers/rtc/class.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index d37588f08055..7fa32c922617 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -68,7 +68,7 @@ static int rtc_suspend(struct device *dev) return 0; } - getnstimeofday64(&old_system); + ktime_get_real_ts64(&old_system); old_rtc.tv_sec = rtc_tm_to_time64(&tm); @@ -110,7 +110,7 @@ static int rtc_resume(struct device *dev) return 0; /* snapshot the current rtc and system time at resume */ - getnstimeofday64(&new_system); + ktime_get_real_ts64(&new_system); err = rtc_read_time(rtc, &tm); if (err < 0) { pr_debug("%s: fail to read rtc time\n", dev_name(&rtc->dev)); |