Commit 6662b075 authored by Roman Stratiienko's avatar Roman Stratiienko Committed by Jan Kiszka

kernel: cobalt: migrate to ktime_t

As do_gettimeofday is very old and deprecated, use ktime instead

This also fixed the old conversion to nanoseconds in a4l_init_time.
Signed-off-by: default avatarRoman Stratiienko <roman.stratiienko@globallogic.com>
[Jan: leave note on drive-by fix of a4l_init_time]
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent c9810f0a
...@@ -350,9 +350,7 @@ EXPORT_SYMBOL_GPL(xnclock_adjust); ...@@ -350,9 +350,7 @@ EXPORT_SYMBOL_GPL(xnclock_adjust);
xnticks_t xnclock_get_host_time(void) xnticks_t xnclock_get_host_time(void)
{ {
struct timeval tv; return ktime_to_ns(ktime_get_real());
do_gettimeofday(&tv);
return tv.tv_sec * 1000000000ULL + tv.tv_usec * 1000;
} }
EXPORT_SYMBOL_GPL(xnclock_get_host_time); EXPORT_SYMBOL_GPL(xnclock_get_host_time);
......
...@@ -32,11 +32,8 @@ static nanosecs_abs_t a4l_clkofs; ...@@ -32,11 +32,8 @@ static nanosecs_abs_t a4l_clkofs;
void a4l_init_time(void) void a4l_init_time(void)
{ {
nanosecs_abs_t t1, t2; nanosecs_abs_t t1, t2;
struct timeval tv;
t1 = rtdm_clock_read(); t1 = rtdm_clock_read();
do_gettimeofday(&tv); t2 = ktime_to_ns(ktime_get_real());
t2 = 1000000000 * ((nanosecs_abs_t)tv.tv_sec) +
1000000 * ((nanosecs_abs_t)tv.tv_usec);
a4l_clkofs = t2 - t1; a4l_clkofs = t2 - t1;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment