aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/io_edgeport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/io_edgeport.c')
-rw-r--r--drivers/usb/serial/io_edgeport.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
index faedbeb6ba49..3f29e6b0fd19 100644
--- a/drivers/usb/serial/io_edgeport.c
+++ b/drivers/usb/serial/io_edgeport.c
@@ -1965,20 +1965,14 @@ static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned c
1965 int cnt; 1965 int cnt;
1966 1966
1967 do { 1967 do {
1968 if (tty->flip.count >= TTY_FLIPBUF_SIZE) { 1968 cnt = tty_buffer_request_room(tty, length);
1969 tty_flip_buffer_push(tty); 1969 if (cnt < length) {
1970 if (tty->flip.count >= TTY_FLIPBUF_SIZE) { 1970 dev_err(dev, "%s - dropping data, %d bytes lost\n",
1971 dev_err(dev, "%s - dropping data, %d bytes lost\n", 1971 __FUNCTION__, length - cnt);
1972 __FUNCTION__, length); 1972 if(cnt == 0)
1973 return; 1973 break;
1974 }
1975 } 1974 }
1976 cnt = min(length, TTY_FLIPBUF_SIZE - tty->flip.count); 1975 tty_insert_flip_string(tty, data, cnt);
1977 memcpy(tty->flip.char_buf_ptr, data, cnt);
1978 memset(tty->flip.flag_buf_ptr, 0, cnt);
1979 tty->flip.char_buf_ptr += cnt;
1980 tty->flip.flag_buf_ptr += cnt;
1981 tty->flip.count += cnt;
1982 data += cnt; 1976 data += cnt;
1983 length -= cnt; 1977 length -= cnt;
1984 } while (length > 0); 1978 } while (length > 0);