Skip to content

Commit

Permalink
iio: Use ktime_get_real_ns()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Gleixner authored and John Stultz committed Jul 23, 2014
1 parent d659f9b commit fb31cc1
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions include/linux/iio/iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit fb31cc1

Please sign in to comment.