mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-21 04:51:09 +09:00
usb: serial: mos7840: Fixup mos7840_chars_in_buffer()
commit 5c263b92f8 upstream.
* 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d0f56add7c
commit
edbc37fd39
@@ -1191,9 +1191,12 @@ static int mos7840_chars_in_buffer(struct tty_struct *tty)
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&mos7840_port->pool_lock, flags);
|
||||
for (i = 0; i < NUM_URBS; ++i)
|
||||
if (mos7840_port->busy[i])
|
||||
chars += URB_TRANSFER_BUFFER_SIZE;
|
||||
for (i = 0; i < NUM_URBS; ++i) {
|
||||
if (mos7840_port->busy[i]) {
|
||||
struct urb *urb = mos7840_port->write_urb_pool[i];
|
||||
chars += urb->transfer_buffer_length;
|
||||
}
|
||||
}
|
||||
spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
|
||||
dbg("%s - returns %d", __func__, chars);
|
||||
return chars;
|
||||
|
||||
Reference in New Issue
Block a user