aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/serial/serial_core.c8
-rw-r--r--include/linux/serial_core.h1
2 files changed, 7 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 }
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 7a6daf189995..a23fa29d4eb0 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -365,6 +365,7 @@ struct uart_port {
365 struct device *dev; /* parent device */ 365 struct device *dev; /* parent device */
366 unsigned char hub6; /* this should be in the 8250 driver */ 366 unsigned char hub6; /* this should be in the 8250 driver */
367 unsigned char suspended; 367 unsigned char suspended;
368 unsigned char irq_wake;
368 unsigned char unused[2]; 369 unsigned char unused[2];
369 void *private_data; /* generic platform data pointer */ 370 void *private_data; /* generic platform data pointer */
370}; 371};