Commit 491c021e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: misc: ldusb: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fb3abee6
...@@ -219,16 +219,17 @@ static void ld_usb_interrupt_in_callback(struct urb *urb) ...@@ -219,16 +219,17 @@ static void ld_usb_interrupt_in_callback(struct urb *urb)
struct ld_usb *dev = urb->context; struct ld_usb *dev = urb->context;
size_t *actual_buffer; size_t *actual_buffer;
unsigned int next_ring_head; unsigned int next_ring_head;
int status = urb->status;
int retval; int retval;
if (urb->status) { if (status) {
if (urb->status == -ENOENT || if (status == -ENOENT ||
urb->status == -ECONNRESET || status == -ECONNRESET ||
urb->status == -ESHUTDOWN) { status == -ESHUTDOWN) {
goto exit; goto exit;
} else { } else {
dbg_info(&dev->intf->dev, "%s: nonzero status received: %d\n", dbg_info(&dev->intf->dev, "%s: nonzero status received: %d\n",
__FUNCTION__, urb->status); __FUNCTION__, status);
spin_lock(&dev->rbsl); spin_lock(&dev->rbsl);
goto resubmit; /* maybe we can recover */ goto resubmit; /* maybe we can recover */
} }
...@@ -275,14 +276,15 @@ static void ld_usb_interrupt_in_callback(struct urb *urb) ...@@ -275,14 +276,15 @@ static void ld_usb_interrupt_in_callback(struct urb *urb)
static void ld_usb_interrupt_out_callback(struct urb *urb) static void ld_usb_interrupt_out_callback(struct urb *urb)
{ {
struct ld_usb *dev = urb->context; struct ld_usb *dev = urb->context;
int status = urb->status;
/* sync/async unlink faults aren't errors */ /* sync/async unlink faults aren't errors */
if (urb->status && !(urb->status == -ENOENT || if (status && !(status == -ENOENT ||
urb->status == -ECONNRESET || status == -ECONNRESET ||
urb->status == -ESHUTDOWN)) status == -ESHUTDOWN))
dbg_info(&dev->intf->dev, dbg_info(&dev->intf->dev,
"%s - nonzero write interrupt status received: %d\n", "%s - nonzero write interrupt status received: %d\n",
__FUNCTION__, urb->status); __FUNCTION__, status);
dev->interrupt_out_busy = 0; dev->interrupt_out_busy = 0;
wake_up_interruptible(&dev->write_wait); wake_up_interruptible(&dev->write_wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment