[patch 5/7] usbatm: Detect usb device shutdown and ignore failed urbs

[email protected]
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
From: Simon Arlott <[email protected]>

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]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
---

 drivers/usb/atm/usbatm.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN drivers/usb/atm/usbatm.c~usbatm-detect-usb-device-shutdown-and-ignore-failed-urbs drivers/usb/atm/usbatm.c
--- a/drivers/usb/atm/usbatm.c~usbatm-detect-usb-device-shutdown-and-ignore-failed-urbs
+++ a/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);
_

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.