Skip to content

Commit fb31cc1

Browse files
KAGA-KOKOjohnstultz-work
authored andcommitted
iio: Use ktime_get_real_ns()
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>
1 parent d659f9b commit fb31cc1

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

‎include/linux/iio/iio.h‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,7 @@ static inline bool iio_channel_has_info(const struct iio_chan_spec *chan,
277277
**/
278278
static inline s64 iio_get_time_ns(void)
279279
{
280-
struct timespec ts;
281-
/*
282-
* calls getnstimeofday.
283-
* If hrtimers then up to ns accurate, if not microsecond.
284-
*/
285-
ktime_get_real_ts(&ts);
286-
287-
return timespec_to_ns(&ts);
280+
return ktime_get_real_ns();
288281
}
289282

290283
/* Device operating modes */

0 commit comments

Comments
 (0)