]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/serial/sh-sci.c
sh: Fix up the shared IRQ demuxer's control bit testing logic.
[linux-2.6-omap-h63xx.git] / drivers / serial / sh-sci.c
index 6a5132f840363178ac718aa41dd4ee9df433ffca..5c0f32c7fbf6b20c8e20fba1ec32f7e08af29909 100644 (file)
@@ -797,26 +797,27 @@ static irqreturn_t sci_br_interrupt(int irq, void *ptr)
 
 static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr)
 {
-        unsigned short ssr_status, scr_status;
-        struct uart_port *port = ptr;
+       unsigned short ssr_status, scr_status;
+       struct uart_port *port = ptr;
+       irqreturn_t ret = IRQ_NONE;
 
         ssr_status = sci_in(port,SCxSR);
         scr_status = sci_in(port,SCSCR);
 
        /* Tx Interrupt */
-        if ((ssr_status & 0x0020) && (scr_status & 0x0080))
-                sci_tx_interrupt(irq, ptr);
+       if ((ssr_status & 0x0020) && (scr_status & SCI_CTRL_FLAGS_TIE))
+               ret = sci_tx_interrupt(irq, ptr);
        /* Rx Interrupt */
-        if ((ssr_status & 0x0002) && (scr_status & 0x0040))
-                sci_rx_interrupt(irq, ptr);
+       if ((ssr_status & 0x0002) && (scr_status & SCI_CTRL_FLAGS_RIE))
+               ret = sci_rx_interrupt(irq, ptr);
        /* Error Interrupt */
-        if ((ssr_status & 0x0080) && (scr_status & 0x0400))
-                sci_er_interrupt(irq, ptr);
+       if ((ssr_status & 0x0080) && (scr_status & SCI_CTRL_FLAGS_REIE))
+               ret = sci_er_interrupt(irq, ptr);
        /* Break Interrupt */
-        if ((ssr_status & 0x0010) && (scr_status & 0x0200))
-                sci_br_interrupt(irq, ptr);
+       if ((ssr_status & 0x0010) && (scr_status & SCI_CTRL_FLAGS_REIE))
+               ret = sci_br_interrupt(irq, ptr);
 
-       return IRQ_HANDLED;
+       return ret;
 }
 
 #if defined(CONFIG_CPU_FREQ) && defined(CONFIG_HAVE_CLK)
@@ -1134,7 +1135,7 @@ static int sci_verify_port(struct uart_port *port, struct serial_struct *ser)
 {
        struct sci_port *s = &sci_ports[port->line];
 
-       if (ser->irq != s->irqs[SCIx_TXI_IRQ] || ser->irq > NR_IRQS)
+       if (ser->irq != s->irqs[SCIx_TXI_IRQ] || ser->irq > nr_irqs)
                return -EINVAL;
        if (ser->baud_base < 2400)
                /* No paper tape reader for Mitch.. */