[PATCH printk v2 06/38] tty: nfcon: use console_is_enabled()

From: John Ogness
Date: Wed Oct 19 2022 - 11:04:36 EST


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

Signed-off-by: John Ogness <john.ogness@xxxxxxxxxxxxx>
---
arch/m68k/emu/nfcon.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/m68k/emu/nfcon.c b/arch/m68k/emu/nfcon.c
index 557d60867f98..c542fc2b121f 100644
--- a/arch/m68k/emu/nfcon.c
+++ b/arch/m68k/emu/nfcon.c
@@ -49,7 +49,7 @@ static void nfcon_write(struct console *con, const char *str,
static struct tty_driver *nfcon_device(struct console *con, int *index)
{
*index = 0;
- return (con->flags & CON_ENABLED) ? nfcon_tty_driver : NULL;
+ return console_is_enabled(con) ? nfcon_tty_driver : NULL;
}

static struct console nf_console = {
@@ -151,7 +151,7 @@ static int __init nfcon_init(void)

nfcon_tty_driver = driver;

- if (!(nf_console.flags & CON_ENABLED))
+ if (!console_is_enabled(&nf_console))
register_console(&nf_console);

return 0;
--
2.30.2