From 767acb8c1b427e5cc361a47e5580c0bdcb8defa9 Mon Sep 17 00:00:00 2001 From: Ziyan Date: Sun, 20 Dec 2015 04:31:00 +1100 Subject: staging: iio: use monotonic time since boot for event timestamps Recent Android versions are expecting a monotonic timestamp that includes the time since boot, not the time elapsed since boot while the device was awake. Change-Id: I68681be011162fe102287243f8e200b08d8c31e2 --- drivers/staging/iio/iio.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'drivers/staging/iio') diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h index 38f1425..705dc66 100644 --- a/drivers/staging/iio/iio.h +++ b/drivers/staging/iio/iio.h @@ -181,14 +181,7 @@ int __iio_add_chan_devattr(const char *postfix, **/ static inline s64 iio_get_time_ns(void) { - struct timespec ts; - /* - * calls getnstimeofday. - * If hrtimers then up to ns accurate, if not microsecond. - */ - ktime_get_real_ts(&ts); - - return timespec_to_ns(&ts); + return ktime_to_ns(ktime_get_boottime()); } /* Device operating modes */ -- cgit v1.1