aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2013-10-08 22:39:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-16 16:08:15 -0400
commit09238443c61e58f7fac8a3892b14b1bee40b4316 (patch)
treef2edd0e6b71cd1fee32a795fa04536679ef6594a /drivers/tty
parent12082ba2cb053e547dd3faef7af4842f2abe7c19 (diff)
serial: mrst_max3110: Check the irq number before enable/disabe irq in PM hooks
We should check the validity of the irq number before calling disable_irq() and enable_irq() in the suspend/resume function, as "max->irq == 0" means the irq is not enabled for max3110 device, otherwise it will hurt device whose irq number is really 0. Signed-off-by: Feng Tang <feng.tang@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/mrst_max3110.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/tty/serial/mrst_max3110.c b/drivers/tty/serial/mrst_max3110.c
index a67e7081f001..ee77e7366ed6 100644
--- a/drivers/tty/serial/mrst_max3110.c
+++ b/drivers/tty/serial/mrst_max3110.c
@@ -749,7 +749,8 @@ static int serial_m3110_suspend(struct device *dev)
749 struct spi_device *spi = to_spi_device(dev); 749 struct spi_device *spi = to_spi_device(dev);
750 struct uart_max3110 *max = spi_get_drvdata(spi); 750 struct uart_max3110 *max = spi_get_drvdata(spi);
751 751
752 disable_irq(max->irq); 752 if (max->irq > 0)
753 disable_irq(max->irq);
753 uart_suspend_port(&serial_m3110_reg, &max->port); 754 uart_suspend_port(&serial_m3110_reg, &max->port);
754 max3110_out(max, max->cur_conf | WC_SW_SHDI); 755 max3110_out(max, max->cur_conf | WC_SW_SHDI);
755 return 0; 756 return 0;
@@ -762,7 +763,8 @@ static int serial_m3110_resume(struct device *dev)
762 763
763 max3110_out(max, max->cur_conf); 764 max3110_out(max, max->cur_conf);
764 uart_resume_port(&serial_m3110_reg, &max->port); 765 uart_resume_port(&serial_m3110_reg, &max->port);
765 enable_irq(max->irq); 766 if (max->irq > 0)
767 enable_irq(max->irq);
766 return 0; 768 return 0;
767} 769}
768 770