]> git.karo-electronics.de Git - linux-beck.git/commitdiff
serial: sh-sci: Handle request_irq() failures.
authorPaul Mundt <lethal@linux-sh.org>
Wed, 19 Jan 2011 08:30:53 +0000 (17:30 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 19 Jan 2011 08:30:53 +0000 (17:30 +0900)
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>
drivers/serial/sh-sci.c

index 3fd1577a162fa829aaec90616697eda762b698df..31ac092b16d84837ce8c23abeb6f90456265136a 100644 (file)
@@ -830,6 +830,7 @@ static int sci_notifier(struct notifier_block *self,
        if ((phase == CPUFREQ_POSTCHANGE) ||
            (phase == CPUFREQ_RESUMECHANGE)) {
                struct uart_port *port = &sci_port->port;
+
                spin_lock_irqsave(&port->lock, flags);
                port->uartclk = clk_get_rate(sci_port->iclk);
                spin_unlock_irqrestore(&port->lock, flags);
@@ -1428,14 +1429,19 @@ static inline void sci_free_dma(struct uart_port *port)
 static int sci_startup(struct uart_port *port)
 {
        struct sci_port *s = to_sci_port(port);
+       int ret;
 
        dev_dbg(port->dev, "%s(%d)\n", __func__, port->line);
 
        if (s->enable)
                s->enable(port);
 
-       sci_request_irq(s);
+       ret = sci_request_irq(s);
+       if (unlikely(ret < 0))
+               return ret;
+
        sci_request_dma(port);
+
        sci_start_tx(port);
        sci_start_rx(port);
 
@@ -1450,6 +1456,7 @@ static void sci_shutdown(struct uart_port *port)
 
        sci_stop_rx(port);
        sci_stop_tx(port);
+
        sci_free_dma(port);
        sci_free_irq(s);