]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
serial: sh-sci: Support generic SCLSR overrun detection.
authorPaul Mundt <lethal@linux-sh.org>
Tue, 14 Jun 2011 08:53:34 +0000 (17:53 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 14 Jun 2011 08:53:34 +0000 (17:53 +0900)
For all ports with a valid SCLSR register we can use the generic FIFO
overrun detection logic. Test the validity of the SCLSR register rather
than depending explicitly on port type, which can be ambiguous for the
SCIFA/B types.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/tty/serial/sh-sci.c

index 60027d51bb512bf86b305a33293a6b22ca8535e2..8e55e0a2733a6fdc749d8c8ef0b9a413e507316d 100644 (file)
@@ -734,15 +734,11 @@ static int sci_handle_fifo_overrun(struct uart_port *port)
 {
        struct tty_struct *tty = port->state->port.tty;
        struct sci_port *s = to_sci_port(port);
+       struct plat_sci_reg *reg;
        int copied = 0;
 
-       /*
-        * XXX: Technically not limited to non-SCIFs, it's simply the
-        * SCLSR check that is for the moment SCIF-specific. This
-        * probably wants to be revisited for SCIFA/B as well as for
-        * factoring in SCI overrun detection.
-        */
-       if (port->type != PORT_SCIF)
+       reg = sci_getreg(port, SCLSR);
+       if (!reg->size)
                return 0;
 
        if ((sci_in(port, SCLSR) & (1 << s->cfg->overrun_bit))) {