diff options
author | Felipe Balbi <balbi@ti.com> | 2011-03-21 06:25:08 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-04-22 20:31:53 -0400 |
commit | b1c43f82c5aa265442f82dba31ce985ebb7aa71c (patch) | |
tree | 8b344d8d5355b30e8deff901180edc708a653227 /drivers/tty/vt | |
parent | e9a470f445271eb157ee860a93b062324402fc3a (diff) |
tty: make receive_buf() return the amout of bytes received
it makes it simpler to keep track of the amount of
bytes received and simplifies how flush_to_ldisc counts
the remaining bytes. It also fixes a bug of lost bytes
on n_tty when flushing too many bytes via the USB
serial gadget driver.
Tested-by: Stefan Bigler <stefan.bigler@keymile.com>
Tested-by: Toby Gray <toby.gray@realvnc.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/vt')
-rw-r--r-- | drivers/tty/vt/selection.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/tty/vt/selection.c b/drivers/tty/vt/selection.c index fb864e7fcd1..67b1d0d7c8a 100644 --- a/drivers/tty/vt/selection.c +++ b/drivers/tty/vt/selection.c | |||
@@ -332,8 +332,7 @@ int paste_selection(struct tty_struct *tty) | |||
332 | continue; | 332 | continue; |
333 | } | 333 | } |
334 | count = sel_buffer_lth - pasted; | 334 | count = sel_buffer_lth - pasted; |
335 | count = min(count, tty->receive_room); | 335 | count = tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted, |
336 | tty->ldisc->ops->receive_buf(tty, sel_buffer + pasted, | ||
337 | NULL, count); | 336 | NULL, count); |
338 | pasted += count; | 337 | pasted += count; |
339 | } | 338 | } |