Revert "serial: core: Add support for DEVNAME:0.0 style naming for kernel console"

This reverts commit 787a1cabac01c99846070fcf702e53befaf89f79.

Let's roll back all of the serial core and printk console changes that
went into 6.10-rc1 as there still are problems with them that need to be
sorted out.

Link: https://lore.kernel.org/r/ZnpRozsdw6zbjqze@tlindgre-MOBL1
Reported-by: Petr Mladek <pmladek@suse.com>
Reported-by: Tony Lindgren <tony@atomide.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

-86
-16
drivers/tty/serial/serial_base.h
··· 49 49 50 50 int serial_core_register_port(struct uart_driver *drv, struct uart_port *port); 51 51 void serial_core_unregister_port(struct uart_driver *drv, struct uart_port *port); 52 - 53 - #ifdef CONFIG_SERIAL_CORE_CONSOLE 54 - 55 - int serial_base_add_preferred_console(struct uart_driver *drv, 56 - struct uart_port *port); 57 - 58 - #else 59 - 60 - static inline 61 - int serial_base_add_preferred_console(struct uart_driver *drv, 62 - struct uart_port *port) 63 - { 64 - return 0; 65 - } 66 - 67 - #endif
-66
drivers/tty/serial/serial_base_bus.c
··· 8 8 * The serial core bus manages the serial core controller instances. 9 9 */ 10 10 11 - #include <linux/cleanup.h> 12 11 #include <linux/container_of.h> 13 12 #include <linux/device.h> 14 13 #include <linux/idr.h> ··· 203 204 ida_free(&ctrl_dev->port_ida, port_dev->port->port_id); 204 205 put_device(&port_dev->dev); 205 206 } 206 - 207 - #ifdef CONFIG_SERIAL_CORE_CONSOLE 208 - 209 - static int serial_base_add_one_prefcon(const char *match, const char *dev_name, 210 - int port_id) 211 - { 212 - int ret; 213 - 214 - ret = add_preferred_console_match(match, dev_name, port_id); 215 - if (ret == -ENOENT) 216 - return 0; 217 - 218 - return ret; 219 - } 220 - 221 - static int serial_base_add_prefcon(const char *name, int idx) 222 - { 223 - const char *char_match __free(kfree) = NULL; 224 - 225 - /* Handle the traditional character device name style console=ttyS0 */ 226 - char_match = kasprintf(GFP_KERNEL, "%s%i", name, idx); 227 - if (!char_match) 228 - return -ENOMEM; 229 - 230 - return serial_base_add_one_prefcon(char_match, name, idx); 231 - } 232 - 233 - /** 234 - * serial_base_add_preferred_console - Adds a preferred console 235 - * @drv: Serial port device driver 236 - * @port: Serial port instance 237 - * 238 - * Tries to add a preferred console for a serial port if specified in the 239 - * kernel command line. Supports both the traditional character device such 240 - * as console=ttyS0, and a hardware addressing based console=DEVNAME:0.0 241 - * style name. 242 - * 243 - * Translates the kernel command line option using a hardware based addressing 244 - * console=DEVNAME:0.0 to the serial port character device such as ttyS0. 245 - * Cannot be called early for ISA ports, depends on struct device. 246 - * 247 - * Note that duplicates are ignored by add_preferred_console(). 248 - * 249 - * Return: 0 on success, negative error code on failure. 250 - */ 251 - int serial_base_add_preferred_console(struct uart_driver *drv, 252 - struct uart_port *port) 253 - { 254 - const char *port_match __free(kfree) = NULL; 255 - int ret; 256 - 257 - ret = serial_base_add_prefcon(drv->dev_name, port->line); 258 - if (ret) 259 - return ret; 260 - 261 - port_match = kasprintf(GFP_KERNEL, "%s:%i.%i", dev_name(port->dev), 262 - port->ctrl_id, port->port_id); 263 - if (!port_match) 264 - return -ENOMEM; 265 - 266 - /* Translate a hardware addressing style console=DEVNAME:0.0 */ 267 - return serial_base_add_one_prefcon(port_match, drv->dev_name, port->line); 268 - } 269 - 270 - #endif 271 207 272 208 static int serial_base_init(void) 273 209 {
-4
drivers/tty/serial/serial_core.c
··· 3422 3422 if (ret) 3423 3423 goto err_unregister_ctrl_dev; 3424 3424 3425 - ret = serial_base_add_preferred_console(drv, port); 3426 - if (ret) 3427 - goto err_unregister_port_dev; 3428 - 3429 3425 ret = serial_core_add_one_port(drv, port); 3430 3426 if (ret) 3431 3427 goto err_unregister_port_dev;