Skip to content

Commit 34d9541

Browse files
jognesspmladek
authored andcommitted
tty: hvc: 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 <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-26-john.ogness@linutronix.de
1 parent 794c8e8 commit 34d9541

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/tty/hvc/hvc_console.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ static void hvc_port_destruct(struct tty_port *port)
264264

265265
static void hvc_check_console(int index)
266266
{
267-
/* Already enabled, bail out */
268-
if (hvc_console.flags & CON_ENABLED)
267+
/* Already registered, bail out */
268+
if (console_is_registered(&hvc_console))
269269
return;
270270

271271
/* If this index is what the user requested, then register

0 commit comments

Comments
 (0)