]> Gentwo Git Trees - linux/.git/commit
serial: core: Introduce wrapper to set @uart_port->cons
authorJohn Ogness <john.ogness@linutronix.de>
Tue, 20 Aug 2024 06:29:37 +0000 (08:35 +0206)
committerPetr Mladek <pmladek@suse.com>
Wed, 21 Aug 2024 12:56:23 +0000 (14:56 +0200)
commiteabd4600dafacf9895184259373f2445ff748654
tree90b91a5ba7f25e2418caceae5475672a51e3e7f6
parent77e73c0687f5bc884fa1b0cb97aca912bcc01957
serial: core: Introduce wrapper to set @uart_port->cons

Introduce uart_port_set_cons() as a wrapper to set @cons of a
uart_port. The wrapper sets @cons under the port lock in order
to prevent @cons from disappearing while another context is
holding the port lock. This is necessary for a follow-up
commit relating to the port lock wrappers, which rely on @cons
not changing between lock and unlock.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Tested-by: Théo Lebrun <theo.lebrun@bootlin.com> # EyeQ5, AMBA-PL011
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240820063001.36405-12-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
drivers/tty/serial/8250/8250_core.c
drivers/tty/serial/amba-pl011.c
drivers/tty/serial/serial_core.c
include/linux/serial_core.h