Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 235367
b: refs/heads/master
c: f7d7aed
h: refs/heads/master
i:
  235365: 1fe9cc4
  235363: beec2f9
  235359: d4562db
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Mar 1, 2011
1 parent b93eb8c commit 36c74e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 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: 7adc14b14b43b6ca9f2f00ac7a4780577dbe883b
refs/heads/master: f7d7aedfcd4e20e7dfc7356d30cc22dc0b0f493e
15 changes: 8 additions & 7 deletions trunk/drivers/usb/serial/keyspan_pda.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ static void keyspan_pda_wakeup_write(struct work_struct *work)
container_of(work, struct keyspan_pda_private, wakeup_work);
struct usb_serial_port *port = priv->port;
struct tty_struct *tty = tty_port_tty_get(&port->port);
tty_wakeup(tty);
if (tty)
tty_wakeup(tty);
tty_kref_put(tty);
}

Expand Down Expand Up @@ -206,7 +207,7 @@ static void keyspan_pda_request_unthrottle(struct work_struct *work)
static void keyspan_pda_rx_interrupt(struct urb *urb)
{
struct usb_serial_port *port = urb->context;
struct tty_struct *tty = tty_port_tty_get(&port->port);
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
int retval;
int status = urb->status;
Expand All @@ -223,7 +224,7 @@ static void keyspan_pda_rx_interrupt(struct urb *urb)
/* this urb is terminated, clean up */
dbg("%s - urb shutting down with status: %d",
__func__, status);
goto out;
return;
default:
dbg("%s - nonzero urb status received: %d",
__func__, status);
Expand All @@ -233,12 +234,14 @@ static void keyspan_pda_rx_interrupt(struct urb *urb)
/* see if the message is data or a status interrupt */
switch (data[0]) {
case 0:
/* rest of message is rx data */
if (urb->actual_length) {
tty = tty_port_tty_get(&port->port);
/* rest of message is rx data */
if (tty && urb->actual_length) {
tty_insert_flip_string(tty, data + 1,
urb->actual_length - 1);
tty_flip_buffer_push(tty);
}
tty_kref_put(tty);
break;
case 1:
/* status interrupt */
Expand All @@ -265,8 +268,6 @@ static void keyspan_pda_rx_interrupt(struct urb *urb)
dev_err(&port->dev,
"%s - usb_submit_urb failed with result %d",
__func__, retval);
out:
tty_kref_put(tty);
}


Expand Down

0 comments on commit 36c74e9

Please sign in to comment.