[PATCH 08/19] debug: debug_core: Migrate to register_console_force helper

Marcos Paulo de Souza
2025-12-27T22:38:54Z

The register_console_force function was introduced to register consoles
even on the presence of default consoles, replacing the CON_ENABLE flag
that was forcing the same behavior.

No functional changes.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
kernel/debug/debug_core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index 0b9495187fba..4bf736e5a059 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -941,7 +941,7 @@ static void kgdb_console_write(struct console *co, const char *s,
static struct console kgdbcons = {
.name = "kgdb",
.write = kgdb_console_write,
- .flags = CON_PRINTBUFFER | CON_ENABLED,
+ .flags = CON_PRINTBUFFER,
.index = -1,
};

@@ -950,7 +950,7 @@ static int __init opt_kgdb_con(char *str)
kgdb_use_con = 1;

if (kgdb_io_module_registered && !kgdb_con_registered) {
- register_console(&kgdbcons);
+ register_console_force(&kgdbcons);
kgdb_con_registered = 1;
}

@@ -1071,7 +1071,7 @@ static void kgdb_register_callbacks(void)
register_sysrq_key('g', &sysrq_dbg_op);
#endif
if (kgdb_use_con && !kgdb_con_registered) {
- register_console(&kgdbcons);
+ register_console_force(&kgdbcons);
kgdb_con_registered = 1;
}
}

--
2.52.0