Commit 42e698d5 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

evl/clock: fix discrepancies in set_time() handler



This is an internal interface which should deal with ktime directly,
not timespec64. In addition, rename to set() in order to match the
converse short form read() call.
Signed-off-by: default avatarPhilippe Gerum <rpm@xenomai.org>
parent f04bdd1e
......@@ -37,8 +37,7 @@ struct evl_clock {
struct {
ktime_t (*read)(struct evl_clock *clock);
u64 (*read_cycles)(struct evl_clock *clock);
int (*set_time)(struct evl_clock *clock,
const struct timespec64 *ts);
int (*set)(struct evl_clock *clock, ktime_t date);
void (*program_local_shot)(struct evl_clock *clock);
void (*program_remote_shot)(struct evl_clock *clock,
struct evl_rq *rq);
......@@ -102,11 +101,10 @@ static inline ktime_t evl_read_clock(struct evl_clock *clock)
}
static inline int
evl_set_clock_time(struct evl_clock *clock,
const struct timespec64 *ts)
evl_set_clock_time(struct evl_clock *clock, ktime_t date)
{
if (clock->ops.set_time)
return clock->ops.set_time(clock, ts);
if (clock->ops.set)
return clock->ops.set(clock, date);
return -EOPNOTSUPP;
}
......
......@@ -527,7 +527,7 @@ static int set_clock_time(struct evl_clock *clock,
{
trace_evl_clock_settime(clock, &ts);
return evl_set_clock_time(clock, &ts);
return evl_set_clock_time(clock, timespec64_to_ktime(ts));
}
static void get_timer_value(struct evl_timer *__restrict__ timer,
......
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