]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/sx.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc-merge
[linux-2.6-omap-h63xx.git] / drivers / char / sx.c
index 564f31778eb32453d35fed74b2db1287d9162a0a..64bf89cb574f75d105dd4283a8c8c711fc22ae4e 100644 (file)
@@ -1085,6 +1085,7 @@ static inline void sx_receive_chars (struct sx_port *port)
        int rx_op;
        struct tty_struct *tty;
        int copied=0;
+       unsigned char *rp;
 
        func_enter2 ();
        tty = port->gs.tty;
@@ -1095,8 +1096,8 @@ static inline void sx_receive_chars (struct sx_port *port)
                sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); 
 
                /* Don't copy more bytes than there is room for in the buffer */
-               if (tty->flip.count + c > TTY_FLIPBUF_SIZE) 
-                       c = TTY_FLIPBUF_SIZE - tty->flip.count;
+
+               c = tty_prepare_flip_string(tty, &rp, c);
 
                sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); 
 
@@ -1111,14 +1112,8 @@ static inline void sx_receive_chars (struct sx_port *port)
                sx_dprintk (SX_DEBUG_RECEIVE , "Copying over %d chars. First is %d at %lx\n", c, 
                            read_sx_byte (port->board, CHAN_OFFSET(port,hi_rxbuf) + rx_op),
                            CHAN_OFFSET(port, hi_rxbuf)); 
-               memcpy_fromio (tty->flip.char_buf_ptr, 
+               memcpy_fromio (rp,
                               port->board->base + CHAN_OFFSET(port,hi_rxbuf) + rx_op, c);
-               memset(tty->flip.flag_buf_ptr, TTY_NORMAL, c);
-
-               /* Update the kernel buffer end */
-               tty->flip.count += c;
-               tty->flip.char_buf_ptr += c;
-               tty->flip.flag_buf_ptr += c;
 
                /* This one last. ( Not essential.)
                   It allows the card to start putting more data into the buffer!