Skip to content

Commit a5e4bb6

Browse files
committed
Revert "serial: core: Add support for DEVNAME:0.0 style naming for kernel console"
This reverts commit 787a1ca. 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>
1 parent e406c56 commit a5e4bb6

File tree

3 files changed

+0
-86
lines changed

3 files changed

+0
-86
lines changed

drivers/tty/serial/serial_base.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,3 @@ void serial_ctrl_unregister_port(struct uart_driver *drv, struct uart_port *port
4949

5050
int serial_core_register_port(struct uart_driver *drv, struct uart_port *port);
5151
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

drivers/tty/serial/serial_base_bus.c

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* The serial core bus manages the serial core controller instances.
99
*/
1010

11-
#include <linux/cleanup.h>
1211
#include <linux/container_of.h>
1312
#include <linux/device.h>
1413
#include <linux/idr.h>
@@ -205,71 +204,6 @@ void serial_base_port_device_remove(struct serial_port_device *port_dev)
205204
put_device(&port_dev->dev);
206205
}
207206

208-
#ifdef CONFIG_SERIAL_CORE_CONSOLE
209-
210-
static int serial_base_add_one_prefcon(const char *match, const char *dev_name,
211-
int port_id)
212-
{
213-
int ret;
214-
215-
ret = add_preferred_console_match(match, dev_name, port_id);
216-
if (ret == -ENOENT)
217-
return 0;
218-
219-
return ret;
220-
}
221-
222-
static int serial_base_add_prefcon(const char *name, int idx)
223-
{
224-
const char *char_match __free(kfree) = NULL;
225-
226-
/* Handle the traditional character device name style console=ttyS0 */
227-
char_match = kasprintf(GFP_KERNEL, "%s%i", name, idx);
228-
if (!char_match)
229-
return -ENOMEM;
230-
231-
return serial_base_add_one_prefcon(char_match, name, idx);
232-
}
233-
234-
/**
235-
* serial_base_add_preferred_console - Adds a preferred console
236-
* @drv: Serial port device driver
237-
* @port: Serial port instance
238-
*
239-
* Tries to add a preferred console for a serial port if specified in the
240-
* kernel command line. Supports both the traditional character device such
241-
* as console=ttyS0, and a hardware addressing based console=DEVNAME:0.0
242-
* style name.
243-
*
244-
* Translates the kernel command line option using a hardware based addressing
245-
* console=DEVNAME:0.0 to the serial port character device such as ttyS0.
246-
* Cannot be called early for ISA ports, depends on struct device.
247-
*
248-
* Note that duplicates are ignored by add_preferred_console().
249-
*
250-
* Return: 0 on success, negative error code on failure.
251-
*/
252-
int serial_base_add_preferred_console(struct uart_driver *drv,
253-
struct uart_port *port)
254-
{
255-
const char *port_match __free(kfree) = NULL;
256-
int ret;
257-
258-
ret = serial_base_add_prefcon(drv->dev_name, port->line);
259-
if (ret)
260-
return ret;
261-
262-
port_match = kasprintf(GFP_KERNEL, "%s:%i.%i", dev_name(port->dev),
263-
port->ctrl_id, port->port_id);
264-
if (!port_match)
265-
return -ENOMEM;
266-
267-
/* Translate a hardware addressing style console=DEVNAME:0.0 */
268-
return serial_base_add_one_prefcon(port_match, drv->dev_name, port->line);
269-
}
270-
271-
#endif
272-
273207
static int serial_base_init(void)
274208
{
275209
int ret;

drivers/tty/serial/serial_core.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3422,10 +3422,6 @@ int serial_core_register_port(struct uart_driver *drv, struct uart_port *port)
34223422
if (ret)
34233423
goto err_unregister_ctrl_dev;
34243424

3425-
ret = serial_base_add_preferred_console(drv, port);
3426-
if (ret)
3427-
goto err_unregister_port_dev;
3428-
34293425
ret = serial_core_add_one_port(drv, port);
34303426
if (ret)
34313427
goto err_unregister_port_dev;

0 commit comments

Comments
 (0)