mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
hrtimer: convert kernel/* to the new hrtimer apis
In order to be able to do range hrtimers we need to use accessor functions to the "expire" member of the hrtimer struct. This patch converts kernel/* to these accessors. Signed-off-by: Arjan van de Ven <[email protected]>
This commit is contained in:
parent
23dd7bb09b
commit
cc584b213f
8 changed files with 47 additions and 52 deletions
|
|
@ -668,7 +668,7 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
|
|||
(timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE))
|
||||
timr->it_overrun += (unsigned int) hrtimer_forward(timer, now, iv);
|
||||
|
||||
remaining = ktime_sub(timer->expires, now);
|
||||
remaining = ktime_sub(hrtimer_get_expires(timer), now);
|
||||
/* Return 0 only, when the timer is expired and not pending */
|
||||
if (remaining.tv64 <= 0) {
|
||||
/*
|
||||
|
|
@ -762,7 +762,7 @@ common_timer_set(struct k_itimer *timr, int flags,
|
|||
hrtimer_init(&timr->it.real.timer, timr->it_clock, mode);
|
||||
timr->it.real.timer.function = posix_timer_fn;
|
||||
|
||||
timer->expires = timespec_to_ktime(new_setting->it_value);
|
||||
hrtimer_set_expires(timer, timespec_to_ktime(new_setting->it_value));
|
||||
|
||||
/* Convert interval */
|
||||
timr->it.real.interval = timespec_to_ktime(new_setting->it_interval);
|
||||
|
|
@ -771,14 +771,12 @@ common_timer_set(struct k_itimer *timr, int flags,
|
|||
if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) {
|
||||
/* Setup correct expiry time for relative timers */
|
||||
if (mode == HRTIMER_MODE_REL) {
|
||||
timer->expires =
|
||||
ktime_add_safe(timer->expires,
|
||||
timer->base->get_time());
|
||||
hrtimer_add_expires(timer, timer->base->get_time());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
hrtimer_start(timer, timer->expires, mode);
|
||||
hrtimer_start_expires(timer, mode);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue