usbatm: Detect usb device shutdown and ignore failed urbs
authorSimon Arlott <[email protected]>
Thu, 26 Apr 2007 07:38:04 +0000 (00:38 -0700)
committerGreg Kroah-Hartman <[email protected]>
Fri, 27 Apr 2007 20:28:41 +0000 (13:28 -0700)
Detect usb device shutdown and ignore failed urbs.  This happens when the
driver is unloaded or the device is unplugged.

I'm not sure what other urb statuses should be ignored, and the warning
message doesn't need to be shown when the module is unloaded or the device
is removed.

Signed-off-by: Simon Arlott <[email protected]>
Cc: Duncan Sands <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/usb/atm/usbatm.c

index 746d30ffb732aaeb6802976cc67295552e7eccbc..b3f779f5933a6872bcd691f69d69f7d283b1da66 100644 (file)
@@ -274,6 +274,9 @@ static void usbatm_complete(struct urb *urb)
                        (!(channel->usbatm->flags & UDSL_IGNORE_EILSEQ) ||
                         urb->status != -EILSEQ ))
        {
+               if (urb->status == -ESHUTDOWN)
+                       return;
+
                if (printk_ratelimit())
                        atm_warn(channel->usbatm, "%s: urb 0x%p failed (%d)!\n",
                                __func__, urb, urb->status);