From: John Ogness Date: Wed, 16 Nov 2022 16:21:41 +0000 (+0106) Subject: tty: serial: xilinx_uartps: use console_is_registered() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4b71a443cb0abdddaf08a5991e28fc510a8d3abd;p=linux.git 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 Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20221116162152.193147-30-john.ogness@linutronix.de --- diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index 2eff7cff57c48..0cbd1892c53b7 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; }