serial: pic32_uart: Utilize uart_console_enabled()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Sat, 6 Aug 2022 22:56:42 +0000 (01:56 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Aug 2022 11:27:55 +0000 (13:27 +0200)
The serial core already provides a helper to check if the given port
is an enabled console. Utilize it instead of open coded variant.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220806225643.40897-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/pic32_uart.c

index f418f1d..1562c2a 100644 (file)
@@ -943,7 +943,7 @@ static int pic32_uart_probe(struct platform_device *pdev)
        }
 
 #ifdef CONFIG_SERIAL_PIC32_CONSOLE
-       if (uart_console(port) && (pic32_console.flags & CON_ENABLED)) {
+       if (uart_console_enabled(port)) {
                /* The peripheral clock has been enabled by console_setup,
                 * so disable it till the port is used.
                 */