From akpm@linux-foundation.org Thu Apr 26 00:38:30 2007 From: Simon Arlott Date: Thu, 26 Apr 2007 00:38:04 -0700 Subject: usbatm: Detect usb device shutdown and ignore failed urbs To: greg@kroah.com Cc: linux-usb-devel@lists.sourceforge.net, akpm@linux-foundation.org, simon@fire.lp0.eu, duncan.sands@math.u-psud.fr Message-ID: <200704260738.l3Q7c5l5024381@shell0.pdx.osdl.net> From: Simon Arlott 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 Cc: Duncan Sands Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/usb/atm/usbatm.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -274,6 +274,9 @@ static void usbatm_complete(struct 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);