/** * hrtimer_cancel - cancel a timer and wait for the handler to finish. * @timer: the timer to be cancelled * * Returns: * 0 when the timer was not active * 1 when the timer was active */ int hrtimer_cancel(struct hrtimer *timer) { for (;;) { int ret = hrtimer_try_to_cancel(timer);
if (ret >= 0) return ret; cpu_relax();
} } EXPORT_SYMBOL_GPL(hrtimer_cancel);