aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 fdbeb6a0e90..fd2463e6bd4 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -1191,9 +1191,12 @@ static int mos7840_chars_in_buffer(struct tty_struct *tty)
1191 } 1191 }
1192 1192
1193 spin_lock_irqsave(&mos7840_port->pool_lock, flags); 1193 spin_lock_irqsave(&mos7840_port->pool_lock, flags);
1194 for (i = 0; i < NUM_URBS; ++i) 1194 for (i = 0; i < NUM_URBS; ++i) {
1195 if (mos7840_port->busy[i]) 1195 if (mos7840_port->busy[i]) {
1196 chars += URB_TRANSFER_BUFFER_SIZE; 1196 struct urb *urb = mos7840_port->write_urb_pool[i];
1197 chars += urb->transfer_buffer_length;
1198 }
1199 }
1197 spin_unlock_irqrestore(&mos7840_port->pool_lock, flags); 1200 spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
1198 dbg("%s - returns %d", __func__, chars); 1201 dbg("%s - returns %d", __func__, chars);
1199 return chars; 1202 return chars;