aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-09-01 16:25:09 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-10-15 13:53:35 -0400
commit97d97224ff361e08777fb33e0fd193ca877dac28 (patch)
tree73a95df8f411c292272ad4d14e153c4e7f32a488
parenta06748ab546fa95c497f10c290221f4a9f249f9b (diff)
[SERIAL] Fix console initialisation ordering
Ensure pm callback is called upon initialisation to place port in correct power saving state. Ensure console is initialised prior to deciding whether to power down the port. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/serial/serial_core.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index a055f58f342f..a3bd3a3f41f3 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -2127,6 +2127,14 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state,
2127 spin_unlock_irqrestore(&port->lock, flags); 2127 spin_unlock_irqrestore(&port->lock, flags);
2128 2128
2129 /* 2129 /*
2130 * If this driver supports console, and it hasn't been
2131 * successfully registered yet, try to re-register it.
2132 * It may be that the port was not available.
2133 */
2134 if (port->cons && !(port->cons->flags & CON_ENABLED))
2135 register_console(port->cons);
2136
2137 /*
2130 * Power down all ports by default, except the 2138 * Power down all ports by default, except the
2131 * console if we have one. 2139 * console if we have one.
2132 */ 2140 */
@@ -2286,6 +2294,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
2286 } 2294 }
2287 2295
2288 state->port = port; 2296 state->port = port;
2297 state->pm_state = -1;
2289 2298
2290 port->cons = drv->cons; 2299 port->cons = drv->cons;
2291 port->info = state->info; 2300 port->info = state->info;
@@ -2308,15 +2317,6 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port)
2308 tty_register_device(drv->tty_driver, port->line, port->dev); 2317 tty_register_device(drv->tty_driver, port->line, port->dev);
2309 2318
2310 /* 2319 /*
2311 * If this driver supports console, and it hasn't been
2312 * successfully registered yet, try to re-register it.
2313 * It may be that the port was not available.
2314 */
2315 if (port->type != PORT_UNKNOWN &&
2316 port->cons && !(port->cons->flags & CON_ENABLED))
2317 register_console(port->cons);
2318
2319 /*
2320 * Ensure UPF_DEAD is not set. 2320 * Ensure UPF_DEAD is not set.
2321 */ 2321 */
2322 port->flags &= ~UPF_DEAD; 2322 port->flags &= ~UPF_DEAD;