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: Greg Kroah-Hartman <gregkh@suse.de>
{
struct completion done;
unsigned long expire;
{
struct completion done;
unsigned long expire;
+ int retval;
+ int status = urb->status;
init_completion(&done);
urb->context = &done;
urb->actual_length = 0;
init_completion(&done);
urb->context = &done;
urb->actual_length = 0;
- status = usb_submit_urb(urb, GFP_NOIO);
- if (unlikely(status))
+ retval = usb_submit_urb(urb, GFP_NOIO);
+ if (unlikely(retval))
goto out;
expire = timeout ? msecs_to_jiffies(timeout) : MAX_SCHEDULE_TIMEOUT;
goto out;
expire = timeout ? msecs_to_jiffies(timeout) : MAX_SCHEDULE_TIMEOUT;
urb->transfer_buffer_length);
usb_kill_urb(urb);
urb->transfer_buffer_length);
usb_kill_urb(urb);
- status = urb->status == -ENOENT ? -ETIMEDOUT : urb->status;
+ retval = status == -ENOENT ? -ETIMEDOUT : status;
out:
if (actual_length)
*actual_length = urb->actual_length;
usb_free_urb(urb);
out:
if (actual_length)
*actual_length = urb->actual_length;
usb_free_urb(urb);
}
/*-------------------------------------------------------------------*/
}
/*-------------------------------------------------------------------*/
static void sg_complete (struct urb *urb)
{
struct usb_sg_request *io = urb->context;
static void sg_complete (struct urb *urb)
{
struct usb_sg_request *io = urb->context;
+ int status = urb->status;
*/
if (io->status
&& (io->status != -ECONNRESET
*/
if (io->status
&& (io->status != -ECONNRESET
- || urb->status != -ECONNRESET)
+ || status != -ECONNRESET)
&& urb->actual_length) {
dev_err (io->dev->bus->controller,
"dev %s ep%d%s scatterlist error %d/%d\n",
io->dev->devpath,
usb_pipeendpoint (urb->pipe),
usb_pipein (urb->pipe) ? "in" : "out",
&& urb->actual_length) {
dev_err (io->dev->bus->controller,
"dev %s ep%d%s scatterlist error %d/%d\n",
io->dev->devpath,
usb_pipeendpoint (urb->pipe),
usb_pipein (urb->pipe) ? "in" : "out",
- urb->status, io->status);
- if (io->status == 0 && urb->status && urb->status != -ECONNRESET) {
- int i, found, status;
+ if (io->status == 0 && status && status != -ECONNRESET) {
+ int i, found, retval;
- io->status = urb->status;
/* the previous urbs, and this one, completed already.
* unlink pending urbs so they won't rx/tx bad data.
/* the previous urbs, and this one, completed already.
* unlink pending urbs so they won't rx/tx bad data.
if (!io->urbs [i] || !io->urbs [i]->dev)
continue;
if (found) {
if (!io->urbs [i] || !io->urbs [i]->dev)
continue;
if (found) {
- status = usb_unlink_urb (io->urbs [i]);
- if (status != -EINPROGRESS
- && status != -ENODEV
- && status != -EBUSY)
+ retval = usb_unlink_urb (io->urbs [i]);
+ if (retval != -EINPROGRESS &&
+ retval != -ENODEV &&
+ retval != -EBUSY)
dev_err (&io->dev->dev,
"%s, unlink --> %d\n",
dev_err (&io->dev->dev,
"%s, unlink --> %d\n",
} else if (urb == io->urbs [i])
found = 1;
}
} else if (urb == io->urbs [i])
found = 1;
}