Skip to content

Commit 6e35d97

Browse files
jognesspmladek
authored andcommitted
tty: serial: earlycon: 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 <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Signed-off-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 34d9541 commit 6e35d97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/serial/earlycon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int __init setup_earlycon(char *buf)
181181
if (!buf || !buf[0])
182182
return -EINVAL;
183183

184-
if (early_con.flags & CON_ENABLED)
184+
if (console_is_registered(&early_con))
185185
return -EALREADY;
186186

187187
again:
@@ -253,7 +253,7 @@ int __init of_setup_earlycon(const struct earlycon_id *match,
253253
bool big_endian;
254254
u64 addr;
255255

256-
if (early_con.flags & CON_ENABLED)
256+
if (console_is_registered(&early_con))
257257
return -EALREADY;
258258

259259
spin_lock_init(&port->lock);

0 commit comments

Comments
 (0)