aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-03-21 06:25:08 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-22 20:31:53 -0400
commitb1c43f82c5aa265442f82dba31ce985ebb7aa71c (patch)
tree8b344d8d5355b30e8deff901180edc708a653227 /drivers/misc
parente9a470f445271eb157ee860a93b062324402fc3a (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/misc')
-rw-r--r--drivers/misc/ti-st/st_core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c
index 486117f72c9f..cb98a7da98ef 100644
--- a/drivers/misc/ti-st/st_core.c
+++ b/drivers/misc/ti-st/st_core.c
@@ -744,8 +744,8 @@ static void st_tty_close(struct tty_struct *tty)
744 pr_debug("%s: done ", __func__); 744 pr_debug("%s: done ", __func__);
745} 745}
746 746
747static void st_tty_receive(struct tty_struct *tty, const unsigned char *data, 747static unsigned int st_tty_receive(struct tty_struct *tty,
748 char *tty_flags, int count) 748 const unsigned char *data, char *tty_flags, int count)
749{ 749{
750#ifdef VERBOSE 750#ifdef VERBOSE
751 print_hex_dump(KERN_DEBUG, ">in>", DUMP_PREFIX_NONE, 751 print_hex_dump(KERN_DEBUG, ">in>", DUMP_PREFIX_NONE,
@@ -758,6 +758,8 @@ static void st_tty_receive(struct tty_struct *tty, const unsigned char *data,
758 */ 758 */
759 st_recv(tty->disc_data, data, count); 759 st_recv(tty->disc_data, data, count);
760 pr_debug("done %s", __func__); 760 pr_debug("done %s", __func__);
761
762 return count;
761} 763}
762 764
763/* wake-up function called in from the TTY layer 765/* wake-up function called in from the TTY layer