diff options
| author | Tony Lindgren <[email protected]> | 2024-07-03 13:06:08 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2024-07-04 15:41:44 +0200 |
| commit | 7640f1a44eba0cc1a41b312080c236f5c668cd50 (patch) | |
| tree | 2f915252361948083a63887dcd0cb87ba3115bb4 /include/linux | |
| parent | 33827dc4ad8982c987ad4066d643693403ce7fd0 (diff) | |
printk: Add match_devname_and_update_preferred_console()
Let's add match_devname_and_update_preferred_console() for driver
subsystems to call during init when the console is ready, and it's
character device name is known. For now, we use it only for the serial
layer to allow console=DEVNAME:0.0 style hardware based addressing for
consoles.
The earlier attempt on doing this caused a regression with the kernel
command line console order as it added calling __add_preferred_console()
again later on during init. A better approach was suggested by Petr where
we add the deferred console to the console_cmdline[] and update it later
on when the console is ready.
Suggested-by: Petr Mladek <[email protected]>
Co-developed-by: Petr Mladek <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/printk.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h index 65c5184470f1..7239976698e4 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -60,6 +60,10 @@ static inline const char *printk_skip_headers(const char *buffer) #define CONSOLE_LOGLEVEL_DEFAULT CONFIG_CONSOLE_LOGLEVEL_DEFAULT #define CONSOLE_LOGLEVEL_QUIET CONFIG_CONSOLE_LOGLEVEL_QUIET +int match_devname_and_update_preferred_console(const char *match, + const char *name, + const short idx); + extern int console_printk[]; #define console_loglevel (console_printk[0]) |