aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMark Ferrell <mferrell@uplogix.com>2012-07-24 15:15:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-08-10 14:51:42 -0400
commit5c263b92f828af6a8cf54041db45ceae5af8f2ab (patch)
tree1922c955cf2458ae9fc9de2125678a157d8882c6 /drivers
parent4840ae17ba7e21f2932120383a2c9a0f30e66123 (diff)
usb: serial: mos7840: Fixup mos7840_chars_in_buffer()
* Use the buffer content length as opposed to the total buffer size. This can be a real problem when using the mos7840 as a usb serial-console as all kernel output is truncated during boot. Signed-off-by: Mark Ferrell <mferrell@uplogix.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/serial/mos7840.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 57eca2448424..009c1d99e146 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1232,9 +1232,12 @@ static int mos7840_chars_in_buffer(struct tty_struct *tty)
1232 return 0; 1232 return 0;
1233 1233
1234 spin_lock_irqsave(&mos7840_port->pool_lock, flags); 1234 spin_lock_irqsave(&mos7840_port->pool_lock, flags);
1235 for (i = 0; i < NUM_URBS; ++i) 1235 for (i = 0; i < NUM_URBS; ++i) {
1236 if (mos7840_port->busy[i]) 1236 if (mos7840_port->busy[i]) {
1237 chars += URB_TRANSFER_BUFFER_SIZE; 1237 struct urb *urb = mos7840_port->write_urb_pool[i];
1238 chars += urb->transfer_buffer_length;
1239 }
1240 }
1238 spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); 1241 spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
1239 dbg("%s - returns %d", __func__, chars); 1242 dbg("%s - returns %d", __func__, chars);
1240 return chars; 1243 return chars;