diff options
author | Tony Lindgren <tony.lindgren@linux.intel.com> | 2024-07-03 13:06:09 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-07-04 16:41:44 +0300 |
commit | 12c91cec3155f79216641162a32e04a59abb6e37 (patch) | |
tree | 0e840ababf87134766fc632f14e35ededf5958ad /drivers/tty/serial/serial_base.h | |
parent | 7640f1a44eba0cc1a41b312080c236f5c668cd50 (diff) | |
download | linux-12c91cec3155f79216641162a32e04a59abb6e37.tar.xz |
serial: core: Add serial_base_match_and_update_preferred_console()
Let's add serial_base_match_and_update_preferred_console() for consoles
using DEVNAME:0.0 style naming.
The earlier approach to add it caused issues in the kernel command line
ordering as we were calling __add_preferred_console() again for the
deferred consoles.
Signed-off-by: Tony Lindgren <tony.lindgren@linux.intel.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Tested-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240703100615.118762-3-tony.lindgren@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/serial_base.h')
-rw-r--r-- | drivers/tty/serial/serial_base.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/tty/serial/serial_base.h b/drivers/tty/serial/serial_base.h index b6c38d2edfd4..0d50db5b660b 100644 --- a/drivers/tty/serial/serial_base.h +++ b/drivers/tty/serial/serial_base.h @@ -49,3 +49,19 @@ void serial_ctrl_unregister_port(struct uart_driver *drv, struct uart_port *port int serial_core_register_port(struct uart_driver *drv, struct uart_port *port); void serial_core_unregister_port(struct uart_driver *drv, struct uart_port *port); + +#ifdef CONFIG_SERIAL_CORE_CONSOLE + +int serial_base_match_and_update_preferred_console(struct uart_driver *drv, + struct uart_port *port); + +#else + +static inline +int serial_base_match_and_update_preferred_console(struct uart_driver *drv, + struct uart_port *port) +{ + return 0; +} + +#endif |