Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195363
b: refs/heads/master
c: e618834
h: refs/heads/master
i:
  195361: 927a3d2
  195359: e3e079d
v: v3
  • Loading branch information
James Maki authored and Greg Kroah-Hartman committed May 20, 2010
1 parent 7100550 commit 32e73dd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 20 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: 71adf118946957839a13aa4d1094183e05c6c094
refs/heads/master: e618834ef9608750a36d03d4aa9a9f931aa788d6
49 changes: 30 additions & 19 deletions trunk/drivers/usb/serial/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,31 +1019,42 @@ static void option_indat_callback(struct urb *urb)
dbg("%s: %p", __func__, urb);

endpoint = usb_pipeendpoint(urb->pipe);
port = urb->context;

if (status) {
port = urb->context;

switch (status) {
case 0:
/* success */
break;
case -ECONNRESET:
case -ENOENT:
case -ESHUTDOWN:
/* this urb is terminated, clean up */
dbg("%s: urb shutting down with status: %d on endpoint %02x.",
__func__, status, endpoint);
return;
default:
dbg("%s: nonzero status: %d on endpoint %02x.",
__func__, status, endpoint);
} else {
goto exit;
}

if (urb->actual_length) {
tty = tty_port_tty_get(&port->port);
if (urb->actual_length) {
tty_insert_flip_string(tty, data, urb->actual_length);
tty_flip_buffer_push(tty);
} else
dbg("%s: empty read urb received", __func__);
tty_insert_flip_string(tty, data, urb->actual_length);
tty_flip_buffer_push(tty);
tty_kref_put(tty);
} else
dbg("%s: empty read urb received", __func__);

/* Resubmit urb so we continue receiving */
if (status != -ESHUTDOWN) {
err = usb_submit_urb(urb, GFP_ATOMIC);
if (err && err != -EPERM)
printk(KERN_ERR "%s: resubmit read urb failed. "
"(%d)", __func__, err);
else
usb_mark_last_busy(port->serial->dev);
}
exit:
/* Resubmit urb so we continue receiving */
err = usb_submit_urb(urb, GFP_ATOMIC);
if (err && err != -EPERM)
printk(KERN_ERR "%s: resubmit read urb failed. "
"(%d)", __func__, err);
else
usb_mark_last_busy(port->serial->dev);

}
return;
}

Expand Down

0 comments on commit 32e73dd

Please sign in to comment.