]> git.hungrycats.org Git - linux/commitdiff
[SERIAL] Keep trying to register our console device.
authorRussell King <rmk@flint.arm.linux.org.uk>
Tue, 19 Oct 2004 17:11:22 +0000 (18:11 +0100)
committerRussell King <rmk@flint.arm.linux.org.uk>
Tue, 19 Oct 2004 17:11:22 +0000 (18:11 +0100)
Some serial drivers receive their serial port device information via
the device model.  This unfortunately means that the selected port
may not be available when the console subsystem initialises, so we
must keep trying to register the console after each port is added.

drivers/serial/serial_core.c

index 1ac6c9d8144cdf047c87bc98d8e07315cea16204..01bb77a57288e0b88a58e93d719e5cee367db03c 100644 (file)
@@ -2225,6 +2225,15 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
         */
        tty_register_device(drv->tty_driver, port->line, port->dev);
 
+       /*
+        * If this driver supports console, and it hasn't been
+        * successfully registered yet, try to re-register it.
+        * It may be that the port was not available.
+        */
+       if (port->type != PORT_UNKNOWN &&
+           port->cons && !(port->cons->flags & CON_ENABLED))
+               register_console(port->cons);
+
  out:
        up(&port_sem);