]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
USB: chipidea: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:45:49 +0000 (11:45 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:01 +0000 (11:19 +0100)
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.

Patch was created by using Coccinelle.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/all/a6e43ac5a90f975343e1cef2d8346b4697ec0473.1738746904.git.namcao@linutronix.de
drivers/usb/chipidea/otg_fsm.c

index c17516c29b63b8b4ab65aacc6e1d381e51ecfa2f..a093544482d5c9103ccc4146fa1bd04822b37519 100644 (file)
@@ -424,8 +424,7 @@ static enum hrtimer_restart ci_otg_hrtimer_func(struct hrtimer *t)
 /* Initialize timers */
 static int ci_otg_init_timers(struct ci_hdrc *ci)
 {
-       hrtimer_init(&ci->otg_fsm_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
-       ci->otg_fsm_hrtimer.function = ci_otg_hrtimer_func;
+       hrtimer_setup(&ci->otg_fsm_hrtimer, ci_otg_hrtimer_func, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
 
        return 0;
 }