Home Home > GIT Browse
diff options
authorAndrew Morton <akpm@osdl.org>2004-02-12 23:47:12 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-02-12 23:47:12 -0800
commit4ddb0339d5ad087df53128eec202d5a67776ef53 (patch)
parentfe252bd747123a3b91d406b700144fe8ae3c787d (diff)
[PATCH] Make serial console work for any port
From: Bjorn Helgaas <bjorn.helgaas@hp.com> The current serial console code only works for ports that are either defined in SERIAL_PORT_DFNS (and set up by serial8250_isa_init_ports()) or registered by early_serial_setup(). On ia64, SERIAL_PORT_DFNS is empty because we discover everything via ACPI and PCI. And we only use early_serial_setup() for one port described by the HCDP firmware table. This patch against 2.6.3-rc2 makes it work for any valid port. If we don't know about the port early, we just return -ENODEV from the setup() function, which leaves the serial console disabled. After the driver has found all the ports, we try to register the serial console again if it hasn't been enabled already. I think the "port->type == PORT_UNKNOWN" test is cleaner than the "port->ops" test -- it more clearly gets to the point of "do we know about this port".
2 files changed, 10 insertions, 3 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index e1cf834f0f6f..904242a8a67b 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -1976,6 +1976,8 @@ static int __init serial8250_console_setup(struct console *co, char *options)
if (co->index >= UART_NR)
co->index = 0;
port = &serial8250_ports[co->index].port;
+ if (port->type == PORT_UNKNOWN)
+ return -ENODEV;
* Temporary fix.
@@ -2007,6 +2009,14 @@ static int __init serial8250_console_init(void)
+static int __init serial8250_late_console_init(void)
+ if (!(serial8250_console.flags & CON_ENABLED))
+ register_console(&serial8250_console);
+ return 0;
#define SERIAL8250_CONSOLE &serial8250_console
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index a78f0521e4c3..94fe0f66224f 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1871,9 +1871,6 @@ uart_set_options(struct uart_port *port, struct console *co,
if (flow == 'r')
termios.c_cflag |= CRTSCTS;
- if (!port->ops)
- return 0; /* "console=" on ia64 */
port->ops->set_termios(port, &termios, NULL);
co->cflag = termios.c_cflag;