summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2026-07-17 11:42:25 +0200
committerPetr Mladek <pmladek@suse.com>2026-07-17 11:42:25 +0200
commit703a9d76a45dd97b19b2432fc1ba4beb4d67a94f (patch)
treebe0ae0feeaea2d48b959dcd673a47f17e550e4ca
parent04a68c4b40960b5430b88eaf3ad2a33234f90c50 (diff)
parent3219f9b61d45129d24fe4b5a070fc1e3d8fae5c5 (diff)
downloadlinux-next-703a9d76a45dd97b19b2432fc1ba4beb4d67a94f.tar.gz
linux-next-703a9d76a45dd97b19b2432fc1ba4beb4d67a94f.zip
Merge branch 'for-7.3-console-registration-cleanup' into for-next
-rw-r--r--kernel/printk/printk.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 6d363e42e2a0..3fcdf4b4e2e5 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3897,9 +3897,6 @@ static int console_call_setup(struct console *newcon, char *options)
* the newly registered console with any of the ones selected
* by either the command line or add_preferred_console() and
* setup/enable it.
- *
- * Care need to be taken with consoles that are statically
- * enabled such as netconsole
*/
static int try_enable_preferred_console(struct console *newcon,
bool user_specified)
@@ -3940,14 +3937,6 @@ static int try_enable_preferred_console(struct console *newcon,
return 0;
}
- /*
- * Some consoles, such as pstore and netconsole, can be enabled even
- * without matching. Accept the pre-enabled consoles only when match()
- * and setup() had a chance to be called.
- */
- if (newcon->flags & CON_ENABLED && c->user_specified == user_specified)
- return 0;
-
return -ENOENT;
}
@@ -4130,6 +4119,14 @@ void register_console(struct console *newcon)
if (err == -ENOENT)
err = try_enable_preferred_console(newcon, false);
+ /*
+ * Some consoles, such as pstore and netconsole, can be enabled even
+ * without matching. Accept them at this stage when they had a chance
+ * to match() and call setup().
+ */
+ if (err == -ENOENT && (newcon->flags & CON_ENABLED))
+ err = 0;
+
/* printk() messages are not printed to the Braille console. */
if (err || newcon->flags & CON_BRL) {
if (newcon->flags & CON_NBCON)