]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: amba-pl011: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:45:57 +0000 (11:45 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:02 +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>
Link: https://lore.kernel.org/all/78e8c0d1b38998eab983fad265751ed13c2b9009.1738746904.git.namcao@linutronix.de
drivers/tty/serial/amba-pl011.c

index 04212c823a91d5a343327292d8ffd95be1465473..98f178bdbcbeccc3518534cf33f90b50df02737d 100644 (file)
@@ -2867,11 +2867,10 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
                        return -EINVAL;
                }
        }
-
-       hrtimer_init(&uap->trigger_start_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       hrtimer_init(&uap->trigger_stop_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-       uap->trigger_start_tx.function = pl011_trigger_start_tx;
-       uap->trigger_stop_tx.function = pl011_trigger_stop_tx;
+       hrtimer_setup(&uap->trigger_start_tx, pl011_trigger_start_tx, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
+       hrtimer_setup(&uap->trigger_stop_tx, pl011_trigger_stop_tx, CLOCK_MONOTONIC,
+                     HRTIMER_MODE_REL);
 
        ret = pl011_setup_port(&dev->dev, uap, &dev->res, portnr);
        if (ret)