diff options
author | John Ogness <john.ogness@linutronix.de> | 2022-11-16 19:21:37 +0300 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2022-12-02 13:25:01 +0300 |
commit | 34d9541edef7f6527d22fde9707b785adbb6d19a (patch) | |
tree | 27e856c2ec780a55938ddb3ed10bc74323636918 /drivers/tty | |
parent | 794c8e847d048e3f7179e2659945767e4cf9a396 (diff) | |
download | linux-34d9541edef7f6527d22fde9707b785adbb6d19a.tar.xz |
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
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/hvc/hvc_console.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index 4802cfaa107f..a683e21df19c 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -264,8 +264,8 @@ static void hvc_port_destruct(struct tty_port *port) static void hvc_check_console(int index) { - /* Already enabled, bail out */ - if (hvc_console.flags & CON_ENABLED) + /* Already registered, bail out */ + if (console_is_registered(&hvc_console)) return; /* If this index is what the user requested, then register |