2022-10-19 15:10:11

by John Ogness

[permalink] [raw]
Subject: [PATCH printk v2 16/38] tty: serial: xilinx_uartps: use console_is_enabled()

Replace (console->flags & CON_ENABLED) usage with console_is_enabled().

Signed-off-by: John Ogness <[email protected]>
---
drivers/tty/serial/xilinx_uartps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 2eff7cff57c4..e1fe95bd55c1 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_enabled(cdns_uart_uart_driver.cons)) {
console_port = NULL;
cdns_uart_console.index = -1;
}
--
2.30.2


2022-10-19 17:08:45

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH printk v2 16/38] tty: serial: xilinx_uartps: use console_is_enabled()

On Wed, Oct 19, 2022 at 05:01:38PM +0206, John Ogness wrote:
> Replace (console->flags & CON_ENABLED) usage with console_is_enabled().
>
> Signed-off-by: John Ogness <[email protected]>

Reviewed-by: Greg Kroah-Hartman <[email protected]>

2022-10-21 15:30:07

by Petr Mladek

[permalink] [raw]
Subject: Re: [PATCH printk v2 16/38] tty: serial: xilinx_uartps: use console_is_enabled()

On Wed 2022-10-19 17:01:38, John Ogness wrote:
> Replace (console->flags & CON_ENABLED) usage with console_is_enabled().
>
> Signed-off-by: John Ogness <[email protected]>
> ---
> drivers/tty/serial/xilinx_uartps.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index 2eff7cff57c4..e1fe95bd55c1 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_enabled(cdns_uart_uart_driver.cons)) {
> console_port = NULL;
> cdns_uart_console.index = -1;

Again, IMHO, we should check here if the console is in console_list.
We should not clean the port and index when the console is already
registered.

Again, this is old problem that might be fixed later.

The change is straightforward. Feel free to use:

Reviewed-by: Petr Mladek <[email protected]>

Best Regards,
Petr