Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364877
b: refs/heads/master
c: 2c992cd
h: refs/heads/master
i:
  364875: 15246f6
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Apr 19, 2013
1 parent 2f09792 commit 8e49285
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b5784f7d8528926d69c5868f1ddb2af99f85e799
refs/heads/master: 2c992cd73772bd0ef107536e8e3399d28493caa8
8 changes: 8 additions & 0 deletions trunk/drivers/usb/serial/ti_usb_3410_5052.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ static int ti_chars_in_buffer(struct tty_struct *tty)
struct ti_port *tport = usb_get_serial_port_data(port);
int chars = 0;
unsigned long flags;
int ret;
u8 lsr;

if (tport == NULL)
return 0;
Expand All @@ -695,6 +697,12 @@ static int ti_chars_in_buffer(struct tty_struct *tty)
chars = kfifo_len(&tport->write_fifo);
spin_unlock_irqrestore(&tport->tp_lock, flags);

if (!chars) {
ret = ti_get_lsr(tport, &lsr);
if (!ret && !(lsr & TI_LSR_TX_EMPTY))
chars = 1;
}

dev_dbg(&port->dev, "%s - returns %d\n", __func__, chars);
return chars;
}
Expand Down

0 comments on commit 8e49285

Please sign in to comment.