aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/serial_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/serial_core.c')
-rw-r--r--drivers/serial/serial_core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 2835e29298ed..76418c139ffa 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -1986,7 +1986,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
1986 1986
1987 tty_dev = device_find_child(uport->dev, &match, serial_match_port); 1987 tty_dev = device_find_child(uport->dev, &match, serial_match_port);
1988 if (device_may_wakeup(tty_dev)) { 1988 if (device_may_wakeup(tty_dev)) {
1989 enable_irq_wake(uport->irq); 1989 if (!enable_irq_wake(uport->irq))
1990 uport->irq_wake = 1;
1990 put_device(tty_dev); 1991 put_device(tty_dev);
1991 mutex_unlock(&port->mutex); 1992 mutex_unlock(&port->mutex);
1992 return 0; 1993 return 0;
@@ -2052,7 +2053,10 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
2052 2053
2053 tty_dev = device_find_child(uport->dev, &match, serial_match_port); 2054 tty_dev = device_find_child(uport->dev, &match, serial_match_port);
2054 if (!uport->suspended && device_may_wakeup(tty_dev)) { 2055 if (!uport->suspended && device_may_wakeup(tty_dev)) {
2055 disable_irq_wake(uport->irq); 2056 if (uport->irq_wake) {
2057 disable_irq_wake(uport->irq);
2058 uport->irq_wake = 0;
2059 }
2056 mutex_unlock(&port->mutex); 2060 mutex_unlock(&port->mutex);
2057 return 0; 2061 return 0;
2058 } 2062 }