summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)