serial_core: replace uart_console_enabled() with uart_console_registered()
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 16 Nov 2022 16:21:34 +0000 (17:27 +0106)
committerPetr Mladek <pmladek@suse.com>
Fri, 2 Dec 2022 10:25:01 +0000 (11:25 +0100)
commit452b9b24754044eced1508f9090611f3d9aa4ca5
tree2a62bf857667426d2b2edc65da299276cc45c69a
parent1fd4224a6b641f1949e27bf350b5b1c1e47e2ccc
serial_core: replace uart_console_enabled() with uart_console_registered()

All users of uart_console_enabled() really want to know if a console
is registered. It is not reliable to check for CON_ENABLED in order
to identify if a console is registered. Use console_is_registered()
instead.

A _locked() variant is provided because uart_set_options() is always
called with the console_list_lock held and must check if a console
is registered in order to synchronize with kgdboc.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20221116162152.193147-23-john.ogness@linutronix.de
drivers/tty/serial/8250/8250_core.c
drivers/tty/serial/pic32_uart.c
drivers/tty/serial/serial_core.c
include/linux/serial_core.h