]> err.no Git - linux-2.6/blobdiff - drivers/serial/sa1100.c
[PATCH] Additions to .data.read_mostly section
[linux-2.6] / drivers / serial / sa1100.c
index 086065210d1e07b3cb24a1f41596e282d920ed50..1225b14f6e9d4bb7469bb1f6019bf877936f1b54 100644 (file)
@@ -145,7 +145,7 @@ static void sa1100_timeout(unsigned long data)
 /*
  * interrupts disabled on entry
  */
-static void sa1100_stop_tx(struct uart_port *port, unsigned int tty_stop)
+static void sa1100_stop_tx(struct uart_port *port)
 {
        struct sa1100_port *sport = (struct sa1100_port *)port;
        u32 utcr3;
@@ -158,7 +158,7 @@ static void sa1100_stop_tx(struct uart_port *port, unsigned int tty_stop)
 /*
  * interrupts may not be disabled on entry
  */
-static void sa1100_start_tx(struct uart_port *port, unsigned int tty_start)
+static void sa1100_start_tx(struct uart_port *port)
 {
        struct sa1100_port *sport = (struct sa1100_port *)port;
        unsigned long flags;
@@ -197,7 +197,7 @@ static void
 sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs)
 {
        struct tty_struct *tty = sport->port.info->tty;
-       unsigned int status, ch, flg, ignored = 0;
+       unsigned int status, ch, flg;
 
        status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
                 UTSR0_TO_SM(UART_GET_UTSR0(sport));
@@ -214,56 +214,36 @@ sa1100_rx_chars(struct sa1100_port *sport, struct pt_regs *regs)
                 * note that the error handling code is
                 * out of the main execution path
                 */
-               if (status & UTSR1_TO_SM(UTSR1_PRE | UTSR1_FRE | UTSR1_ROR))
-                       goto handle_error;
+               if (status & UTSR1_TO_SM(UTSR1_PRE | UTSR1_FRE | UTSR1_ROR)) {
+                       if (status & UTSR1_TO_SM(UTSR1_PRE))
+                               sport->port.icount.parity++;
+                       else if (status & UTSR1_TO_SM(UTSR1_FRE))
+                               sport->port.icount.frame++;
+                       if (status & UTSR1_TO_SM(UTSR1_ROR))
+                               sport->port.icount.overrun++;
+
+                       status &= sport->port.read_status_mask;
+
+                       if (status & UTSR1_TO_SM(UTSR1_PRE))
+                               flg = TTY_PARITY;
+                       else if (status & UTSR1_TO_SM(UTSR1_FRE))
+                               flg = TTY_FRAME;
+
+#ifdef SUPPORT_SYSRQ
+                       sport->port.sysrq = 0;
+#endif
+               }
 
                if (uart_handle_sysrq_char(&sport->port, ch, regs))
                        goto ignore_char;
 
-       error_return:
-               tty_insert_flip_char(tty, ch, flg);
+               uart_insert_char(&sport->port, status, UTSR1_TO_SM(UTSR1_ROR), ch, flg);
+
        ignore_char:
                status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
                         UTSR0_TO_SM(UART_GET_UTSR0(sport));
        }
- out:
        tty_flip_buffer_push(tty);
-       return;
-
- handle_error:
-       if (status & UTSR1_TO_SM(UTSR1_PRE))
-               sport->port.icount.parity++;
-       else if (status & UTSR1_TO_SM(UTSR1_FRE))
-               sport->port.icount.frame++;
-       if (status & UTSR1_TO_SM(UTSR1_ROR))
-               sport->port.icount.overrun++;
-
-       if (status & sport->port.ignore_status_mask) {
-               if (++ignored > 100)
-                       goto out;
-               goto ignore_char;
-       }
-
-       status &= sport->port.read_status_mask;
-
-       if (status & UTSR1_TO_SM(UTSR1_PRE))
-               flg = TTY_PARITY;
-       else if (status & UTSR1_TO_SM(UTSR1_FRE))
-               flg = TTY_FRAME;
-
-       if (status & UTSR1_TO_SM(UTSR1_ROR)) {
-               /*
-                * overrun does *not* affect the character
-                * we read from the FIFO
-                */
-               tty_insert_flip_char(tty, ch, flg);
-               ch = 0;
-               flg = TTY_OVERRUN;
-       }
-#ifdef SUPPORT_SYSRQ
-       sport->port.sysrq = 0;
-#endif
-       goto error_return;
 }
 
 static void sa1100_tx_chars(struct sa1100_port *sport)
@@ -284,7 +264,7 @@ static void sa1100_tx_chars(struct sa1100_port *sport)
        sa1100_mctrl_check(sport);
 
        if (uart_circ_empty(xmit) || uart_tx_stopped(&sport->port)) {
-               sa1100_stop_tx(&sport->port, 0);
+               sa1100_stop_tx(&sport->port);
                return;
        }
 
@@ -304,7 +284,7 @@ static void sa1100_tx_chars(struct sa1100_port *sport)
                uart_write_wakeup(&sport->port);
 
        if (uart_circ_empty(xmit))
-               sa1100_stop_tx(&sport->port, 0);
+               sa1100_stop_tx(&sport->port);
 }
 
 static irqreturn_t sa1100_int(int irq, void *dev_id, struct pt_regs *regs)