iio: Use ktime_get_real_ns()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 16 Jul 2014 21:04:49 +0000 (21:04 +0000)
committerJohn Stultz <john.stultz@linaro.org>
Wed, 23 Jul 2014 22:01:45 +0000 (15:01 -0700)
No idea why iio needs wall clock based time stamps, but we can avoid
the timespec conversion dance by using the new interfaces.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
include/linux/iio/iio.h

index ccde91725f98c3b28212dc91400ec2ee5a71a686..15dc6bc2bdd2e0da285ea333ef014ba576b4bbff 100644 (file)
@@ -277,14 +277,7 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
  **/
 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_get_real_ns();
 }
 
 /* Device operating modes */