public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RESEND] rtc: use ktime_get_real_ts64() instead of getnstimeofday64()
@ 2018-07-11 12:47 Arnd Bergmann
  2018-07-13  8:49 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-07-11 12:47 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: y2038, Arnd Bergmann, Jason Gunthorpe, John Stultz, Baolin Wang,
	linux-rtc, linux-kernel

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>
---
Originally sent on Jun 18, but got no reply

Alexandre, could you pick this up into the rtc tree?
---
 drivers/rtc/class.c | 4 ++--
 1 file 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));
-- 
2.9.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-13  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-11 12:47 [PATCH] [RESEND] rtc: use ktime_get_real_ts64() instead of getnstimeofday64() Arnd Bergmann
2018-07-13  8:49 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox