diff options
Diffstat (limited to 'drivers/usb/serial/io_ti.c')
-rw-r--r-- | drivers/usb/serial/io_ti.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 2edf9cabad20..afc0f34b3a46 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -1865,20 +1865,14 @@ static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned c | |||
1865 | int cnt; | 1865 | int cnt; |
1866 | 1866 | ||
1867 | do { | 1867 | do { |
1868 | if (tty->flip.count >= TTY_FLIPBUF_SIZE) { | 1868 | cnt = tty_buffer_request_room(tty, length); |
1869 | tty_flip_buffer_push(tty); | 1869 | if (cnt < length) { |
1870 | if (tty->flip.count >= TTY_FLIPBUF_SIZE) { | 1870 | dev_err(dev, "%s - dropping data, %d bytes lost\n", |
1871 | dev_err(dev, "%s - dropping data, %d bytes lost\n", | 1871 | __FUNCTION__, length - cnt); |
1872 | __FUNCTION__, length); | 1872 | if(cnt == 0) |
1873 | return; | 1873 | break; |
1874 | } | ||
1875 | } | 1874 | } |
1876 | cnt = min(length, TTY_FLIPBUF_SIZE - tty->flip.count); | 1875 | tty_insert_flip_string(tty, data, cnt); |
1877 | memcpy(tty->flip.char_buf_ptr, data, cnt); | ||
1878 | memset(tty->flip.flag_buf_ptr, 0, cnt); | ||
1879 | tty->flip.char_buf_ptr += cnt; | ||
1880 | tty->flip.flag_buf_ptr += cnt; | ||
1881 | tty->flip.count += cnt; | ||
1882 | data += cnt; | 1876 | data += cnt; |
1883 | length -= cnt; | 1877 | length -= cnt; |
1884 | } while (length > 0); | 1878 | } while (length > 0); |