]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: imx: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:45:58 +0000 (11:45 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:03 +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/ad27070bc67c13f8a9acbd5cbf4cbae72797e3e1.1738746904.git.namcao@linutronix.de
drivers/tty/serial/imx.c

index 9c59ec128bb4fc0ff54cb9a1a66eabbc9e391a9a..9a1afe409b98980a9394adb47e2254d94cd178b9 100644 (file)
@@ -2582,10 +2582,10 @@ static int imx_uart_probe(struct platform_device *pdev)
                imx_uart_writel(sport, ucr3, UCR3);
        }
 
-       hrtimer_init(&sport->trigger_start_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       hrtimer_init(&sport->trigger_stop_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       sport->trigger_start_tx.function = imx_trigger_start_tx;
-       sport->trigger_stop_tx.function = imx_trigger_stop_tx;
+       hrtimer_setup(&sport->trigger_start_tx, imx_trigger_start_tx, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
+       hrtimer_setup(&sport->trigger_stop_tx, imx_trigger_stop_tx, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
 
        /*
         * Allocate the IRQ(s) i.MX1 has three interrupts whereas later