ChangeSet 1.1608.84.26, 2004/03/10 13:30:47-08:00, david-b@pacbell.net [PATCH] USB: usb_unlink_urb() has distinct "not linked" fault This gets rid of an often-bogus diagnostic, and lets at least the unlink test code recover reasonably when it hits that brief window while another CPU has gotten the complete() callback but hasn't yet resubmitted. Return distinct code when unlinking an urb that's not linked. This lets drivers handle this fault sanely, when they need to. Gets rid of annoying non-error messages about drivers that unlink in disconnect() even when the urb isn't linked. drivers/usb/core/hcd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c --- a/drivers/usb/core/hcd.c Tue Mar 16 15:02:09 2004 +++ b/drivers/usb/core/hcd.c Tue Mar 16 15:02:09 2004 @@ -1213,7 +1213,7 @@ break; } if (tmp != &urb->urb_list) { - retval = -EINVAL; + retval = -EIDRM; goto done; } @@ -1294,7 +1294,7 @@ spin_unlock (&hcd_data_lock); spin_unlock_irqrestore (&urb->lock, flags); bye: - if (retval && sys && sys->driver) + if (retval != -EIDRM && sys && sys->driver) dev_dbg (sys, "hcd_unlink_urb %p fail %d\n", urb, retval); return retval; }