Skip to content

Commit

Permalink
usb_wwan: fix error in marking device busy
Browse files Browse the repository at this point in the history
This fixes two errors:
- the device is busy if a message was recieved even if resubmission fails
- the device is not busy if resubmission fails due to -EPERM

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Feb 17, 2011
1 parent 8ab1040 commit c9c4558
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/usb/serial/usb_wwan.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,16 @@ static void usb_wwan_indat_callback(struct urb *urb)
/* 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
if (err) {
if (err != -EPERM) {
printk(KERN_ERR "%s: resubmit read urb failed. "
"(%d)", __func__, err);
/* busy also in error unless we are killed */
usb_mark_last_busy(port->serial->dev);
}
} else {
usb_mark_last_busy(port->serial->dev);
}
}

}
Expand Down

0 comments on commit c9c4558

Please sign in to comment.