Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61951
b: refs/heads/master
c: 3fc3e82
h: refs/heads/master
i:
  61949: ec8c784
  61947: 2df2393
  61943: b61eb7e
  61935: eb4def7
  61919: 4f84390
  61887: cd02899
  61823: 168bb8c
  61695: 9379976
  61439: aaeee93
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2007
1 parent f5cf187 commit b28b183
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 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: b44cd112a0400d5eb381f3c1a1e7a6925911c835
refs/heads/master: 3fc3e8269fa5c1f35b518dbe18dc48acef3c7684
34 changes: 18 additions & 16 deletions trunk/drivers/usb/core/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int *actual_length)
{
struct completion done;
unsigned long expire;
int status;
int retval;
int status = urb->status;

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;
Expand All @@ -55,15 +56,15 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int *actual_length)
urb->transfer_buffer_length);

usb_kill_urb(urb);
status = urb->status == -ENOENT ? -ETIMEDOUT : urb->status;
retval = status == -ENOENT ? -ETIMEDOUT : status;
} else
status = urb->status;
retval = status;
out:
if (actual_length)
*actual_length = urb->actual_length;

usb_free_urb(urb);
return status;
return retval;
}

/*-------------------------------------------------------------------*/
Expand Down Expand Up @@ -250,6 +251,7 @@ static void sg_clean (struct usb_sg_request *io)
static void sg_complete (struct urb *urb)
{
struct usb_sg_request *io = urb->context;
int status = urb->status;

spin_lock (&io->lock);

Expand All @@ -265,21 +267,21 @@ static void sg_complete (struct urb *urb)
*/
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->status, io->status);
status, io->status);
// BUG ();
}

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;
io->status = status;

/* the previous urbs, and this one, completed already.
* unlink pending urbs so they won't rx/tx bad data.
Expand All @@ -290,13 +292,13 @@ static void sg_complete (struct urb *urb)
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",
__FUNCTION__, status);
__FUNCTION__, retval);
} else if (urb == io->urbs [i])
found = 1;
}
Expand Down

0 comments on commit b28b183

Please sign in to comment.