[ARM] 3523/1: Serial core pm_state
authorAndrew Victor <andrew@sanpeople.com>
Tue, 16 May 2006 10:28:49 +0000 (11:28 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 16 May 2006 10:28:49 +0000 (11:28 +0100)
Patch from Andrew Victor

The serial_core already manages the power state of the UARTs, and
therefore it shouldn't suspend a UART which was previously suspended.

This patch modifies serial_core only call the UART-specific
power-management function if the PM state is actually changing.

Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/serial/serial_core.c

index aeb8153ccf2466eae358d0610af4a61300ce4c8d..17839e753e4cfb1fb550832d8613b0ec579c83ef 100644 (file)
@@ -1907,9 +1907,12 @@ uart_set_options(struct uart_port *port, struct console *co,
 static void uart_change_pm(struct uart_state *state, int pm_state)
 {
        struct uart_port *port = state->port;
-       if (port->ops->pm)
-               port->ops->pm(port, pm_state, state->pm_state);
-       state->pm_state = pm_state;
+
+       if (state->pm_state != pm_state) {
+               if (port->ops->pm)
+                       port->ops->pm(port, pm_state, state->pm_state);
+               state->pm_state = pm_state;
+       }
 }
 
 int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)