Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

treewide: Convert new and leftover hrtimer_init() users

hrtimer_setup() takes the callback function pointer as argument and
initializes the timer completely.

Replace hrtimer_init() and the open coded initialization of
hrtimer::function with the new setup mechanism.

Coccinelle scripted cleanup.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Thomas Gleixner and committed by
Ingo Molnar
48ad7bbf 8fa7292f

+9 -12
+1 -2
drivers/input/joystick/walkera0701.c
··· 232 232 goto err_unregister_device; 233 233 } 234 234 235 - hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 236 - w->timer.function = timer_handler; 235 + hrtimer_setup(&w->timer, timer_handler, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 237 236 238 237 w->input_dev = input_allocate_device(); 239 238 if (!w->input_dev) {
+4 -6
drivers/input/keyboard/gpio_keys.c
··· 590 590 591 591 INIT_DELAYED_WORK(&bdata->work, gpio_keys_gpio_work_func); 592 592 593 - hrtimer_init(&bdata->debounce_timer, 594 - CLOCK_REALTIME, HRTIMER_MODE_REL); 595 - bdata->debounce_timer.function = gpio_keys_debounce_timer; 593 + hrtimer_setup(&bdata->debounce_timer, gpio_keys_debounce_timer, 594 + CLOCK_REALTIME, HRTIMER_MODE_REL); 596 595 597 596 isr = gpio_keys_gpio_isr; 598 597 irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING; ··· 627 628 } 628 629 629 630 bdata->release_delay = button->debounce_interval; 630 - hrtimer_init(&bdata->release_timer, 631 - CLOCK_REALTIME, HRTIMER_MODE_REL_HARD); 632 - bdata->release_timer.function = gpio_keys_irq_timer; 631 + hrtimer_setup(&bdata->release_timer, gpio_keys_irq_timer, 632 + CLOCK_REALTIME, HRTIMER_MODE_REL_HARD); 633 633 634 634 isr = gpio_keys_irq_isr; 635 635 irqflags = 0;
+2 -2
drivers/net/netdevsim/netdev.c
··· 441 441 442 442 static void nsim_rq_timer_init(struct nsim_rq *rq) 443 443 { 444 - hrtimer_init(&rq->napi_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 445 - rq->napi_timer.function = nsim_napi_schedule; 444 + hrtimer_setup(&rq->napi_timer, nsim_napi_schedule, CLOCK_MONOTONIC, 445 + HRTIMER_MODE_REL); 446 446 } 447 447 448 448 static void nsim_enable_napi(struct netdevsim *ns)
+2 -2
drivers/pps/generators/pps_gen_tio.c
··· 227 227 return PTR_ERR(tio->base); 228 228 229 229 pps_tio_disable(tio); 230 - hrtimer_init(&tio->timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); 231 - tio->timer.function = hrtimer_callback; 230 + hrtimer_setup(&tio->timer, hrtimer_callback, CLOCK_REALTIME, 231 + HRTIMER_MODE_ABS); 232 232 spin_lock_init(&tio->lock); 233 233 platform_set_drvdata(pdev, &tio); 234 234