aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ogness <[email protected]>2022-11-16 17:27:41 +0106
committerPetr Mladek <[email protected]>2022-12-02 11:25:01 +0100
commit4b71a443cb0abdddaf08a5991e28fc510a8d3abd (patch)
tree59a15b0c53fb678e48ce01efa3033bddc966ccdf
parentad3b7f6141f8eeac275ca3f93c81596250125b4c (diff)
tty: serial: xilinx_uartps: use 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. Signed-off-by: John Ogness <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/tty/serial/xilinx_uartps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 2eff7cff57c4..0cbd1892c53b 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1631,7 +1631,7 @@ static int cdns_uart_probe(struct platform_device *pdev)
#ifdef CONFIG_SERIAL_XILINX_PS_UART_CONSOLE
/* This is not port which is used for console that's why clean it up */
if (console_port == port &&
- !(cdns_uart_uart_driver.cons->flags & CON_ENABLED)) {
+ !console_is_registered(cdns_uart_uart_driver.cons)) {
console_port = NULL;
cdns_uart_console.index = -1;
}