]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tty: serial: samsung_tty: use console_is_registered()
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 16 Nov 2022 16:21:40 +0000 (17:27 +0106)
committerPetr Mladek <pmladek@suse.com>
Fri, 2 Dec 2022 10:25:01 +0000 (11:25 +0100)
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 <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-29-john.ogness@linutronix.de
drivers/tty/serial/samsung_tty.c

index 77d1363029f558b76d1e84dfb6b38a25ec44afdc..9c252c9ca95ad98d4051733276eb972c4f89ff30 100644 (file)
@@ -1732,7 +1732,7 @@ static void __init s3c24xx_serial_register_console(void)
 
 static void s3c24xx_serial_unregister_console(void)
 {
-       if (s3c24xx_serial_console.flags & CON_ENABLED)
+       if (console_is_registered(&s3c24xx_serial_console))
                unregister_console(&s3c24xx_serial_console);
 }