Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354569
b: refs/heads/master
c: 810360a
h: refs/heads/master
i:
  354567: cc0e8fd
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Jan 18, 2013
1 parent a1ef636 commit 44fb212
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fcdb6a21903bcab0b5f788ba7eb0c31dd06040fd
refs/heads/master: 810360a03597afc0d43a45798a52cfb69b8453d3
14 changes: 10 additions & 4 deletions trunk/drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,21 @@ static int serial_write_room(struct tty_struct *tty)
static int serial_chars_in_buffer(struct tty_struct *tty)
{
struct usb_serial_port *port = tty->driver_data;
struct usb_serial *serial = port->serial;
int count = 0;

dev_dbg(tty->dev, "%s - port %d\n", __func__, port->number);

mutex_lock(&serial->disc_mutex);
/* if the device was unplugged then any remaining characters
fell out of the connector ;) */
if (port->serial->disconnected)
return 0;
/* pass on to the driver specific version of this function */
return port->serial->type->chars_in_buffer(tty);
if (serial->disconnected)
count = 0;
else
count = serial->type->chars_in_buffer(tty);
mutex_unlock(&serial->disc_mutex);

return count;
}

static void serial_throttle(struct tty_struct *tty)
Expand Down

0 comments on commit 44fb212

Please sign in to comment.