aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-01-19 03:30:53 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-01-19 03:30:53 -0500
commit073e84c9320e3fbd26b6a2537c6f592466b25af3 (patch)
tree38e63dc73d423f0b992bb91d275fd8ff56265595
parentd535a2305facf9b49a65bd412c6deaaf4d4316f2 (diff)
serial: sh-sci: Handle request_irq() failures.
request_irq() can fail, so actually do something with the error path instead of blindly ignoring it. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--drivers/serial/sh-sci.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 3fd1577a162f..31ac092b16d8 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -830,6 +830,7 @@ static int sci_notifier(struct notifier_block *self,
830 if ((phase == CPUFREQ_POSTCHANGE) || 830 if ((phase == CPUFREQ_POSTCHANGE) ||
831 (phase == CPUFREQ_RESUMECHANGE)) { 831 (phase == CPUFREQ_RESUMECHANGE)) {
832 struct uart_port *port = &sci_port->port; 832 struct uart_port *port = &sci_port->port;
833
833 spin_lock_irqsave(&port->lock, flags); 834 spin_lock_irqsave(&port->lock, flags);
834 port->uartclk = clk_get_rate(sci_port->iclk); 835 port->uartclk = clk_get_rate(sci_port->iclk);
835 spin_unlock_irqrestore(&port->lock, flags); 836 spin_unlock_irqrestore(&port->lock, flags);
@@ -1428,14 +1429,19 @@ static inline void sci_free_dma(struct uart_port *port)
1428static int sci_startup(struct uart_port *port) 1429static int sci_startup(struct uart_port *port)
1429{ 1430{
1430 struct sci_port *s = to_sci_port(port); 1431 struct sci_port *s = to_sci_port(port);
1432 int ret;
1431 1433
1432 dev_dbg(port->dev, "%s(%d)\n", __func__, port->line); 1434 dev_dbg(port->dev, "%s(%d)\n", __func__, port->line);
1433 1435
1434 if (s->enable) 1436 if (s->enable)
1435 s->enable(port); 1437 s->enable(port);
1436 1438
1437 sci_request_irq(s); 1439 ret = sci_request_irq(s);
1440 if (unlikely(ret < 0))
1441 return ret;
1442
1438 sci_request_dma(port); 1443 sci_request_dma(port);
1444
1439 sci_start_tx(port); 1445 sci_start_tx(port);
1440 sci_start_rx(port); 1446 sci_start_rx(port);
1441 1447
@@ -1450,6 +1456,7 @@ static void sci_shutdown(struct uart_port *port)
1450 1456
1451 sci_stop_rx(port); 1457 sci_stop_rx(port);
1452 sci_stop_tx(port); 1458 sci_stop_tx(port);
1459
1453 sci_free_dma(port); 1460 sci_free_dma(port);
1454 sci_free_irq(s); 1461 sci_free_irq(s);
1455 1462