aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZiyan <jaraidaniel@gmail.com>2015-12-20 04:31:00 +1100
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-03-18 01:51:05 +0100
commit767acb8c1b427e5cc361a47e5580c0bdcb8defa9 (patch)
tree776265f0cb1823f8ccf510d45bf223ec82970c75
parent11bed34c76880b6081bced5f17f6bdf78ce5682f (diff)
downloadkernel_samsung_smdk4412-767acb8c1b427e5cc361a47e5580c0bdcb8defa9.zip
kernel_samsung_smdk4412-767acb8c1b427e5cc361a47e5580c0bdcb8defa9.tar.gz
kernel_samsung_smdk4412-767acb8c1b427e5cc361a47e5580c0bdcb8defa9.tar.bz2
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
-rw-r--r--drivers/staging/iio/iio.h9
1 files changed, 1 insertions, 8 deletions
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 */