Skip to content

Commit 8cb4418

Browse files
covanamgregkh
authored andcommitted
serial: amba-pl011: Switch to use hrtimer_setup()
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 <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/78e8c0d1b38998eab983fad265751ed13c2b9009.1738746904.git.namcao@linutronix.de Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d45545c commit 8cb4418

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/tty/serial/amba-pl011.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2918,11 +2918,10 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
29182918
return -EINVAL;
29192919
}
29202920
}
2921-
2922-
hrtimer_init(&uap->trigger_start_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
2923-
hrtimer_init(&uap->trigger_stop_tx, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
2924-
uap->trigger_start_tx.function = pl011_trigger_start_tx;
2925-
uap->trigger_stop_tx.function = pl011_trigger_stop_tx;
2921+
hrtimer_setup(&uap->trigger_start_tx, pl011_trigger_start_tx, CLOCK_MONOTONIC,
2922+
HRTIMER_MODE_REL);
2923+
hrtimer_setup(&uap->trigger_stop_tx, pl011_trigger_stop_tx, CLOCK_MONOTONIC,
2924+
HRTIMER_MODE_REL);
29262925

29272926
ret = pl011_setup_port(&dev->dev, uap, &dev->res, portnr);
29282927
if (ret)

0 commit comments

Comments
 (0)