]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
igc: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:43:42 +0000 (11:43 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 09:35:47 +0000 (10:35 +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>
Link: https://lore.kernel.org/all/baeaabb84aef1803dfae385f6e9614d6fc547667.1738746872.git.namcao@linutronix.de
drivers/net/ethernet/intel/igc/igc_main.c

index 84307bb7313e0fcb7d598e67586f1ea076c1d942..733820a0c3508b6d762457222882e2b9ef649347 100644 (file)
@@ -7090,8 +7090,8 @@ static int igc_probe(struct pci_dev *pdev,
        INIT_WORK(&adapter->reset_task, igc_reset_task);
        INIT_WORK(&adapter->watchdog_task, igc_watchdog_task);
 
-       hrtimer_init(&adapter->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       adapter->hrtimer.function = &igc_qbv_scheduling_timer;
+       hrtimer_setup(&adapter->hrtimer, &igc_qbv_scheduling_timer, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
 
        /* Initialize link properties that are user-changeable */
        adapter->fc_autoneg = true;