]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: xilinx_uartps: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:46:00 +0000 (11:46 +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/4a028a23126b3350a5e243dcb49e1ef1b2a4b740.1738746904.git.namcao@linutronix.de
drivers/tty/serial/xilinx_uartps.c

index 92ec51870d1daf53c45d479336de3e0b13ae6f27..efb124a19c015796abc0ec08cd65fcedd58de75b 100644 (file)
@@ -1626,8 +1626,8 @@ static int cdns_rs485_config(struct uart_port *port, struct ktermios *termios,
                writel(val, port->membase + CDNS_UART_MODEMCR);
 
                /* Timer setup */
-               hrtimer_init(&cdns_uart->tx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-               cdns_uart->tx_timer.function = &cdns_rs485_tx_callback;
+               hrtimer_setup(&cdns_uart->tx_timer, &cdns_rs485_tx_callback, CLOCK_MONOTONIC,
+                             HRTIMER_MODE_REL);
 
                /* Disable transmitter and make Rx setup*/
                cdns_uart_stop_tx(port);