summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-12-01 15:24:41 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2008-12-17 18:49:14 (GMT)
commit24c0996a6b73e2554104961afcc8659534503e0d (patch)
treece806aca4dbe0b236a639a9067615594f8cdedf6 /drivers/usb
parent9a9fafb89433c5fd1331bac0c84c4b321e358b42 (diff)
downloadlinux-fsl-qoriq-24c0996a6b73e2554104961afcc8659534503e0d.tar.xz
USB: skip Set-Interface(0) if already in altsetting 0
When a driver unbinds from an interface, usbcore always sends a Set-Interface request to reinstall altsetting 0. Unforunately, quite a few devices have buggy firmware that crashes when it receives this request. To avoid such problems, this patch (as1180) arranges to send the Set-Interface request only when the interface is not already in altsetting 0. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/driver.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 3d7793d..8c08130 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -279,7 +279,9 @@ static int usb_unbind_interface(struct device *dev)
* altsetting means creating new endpoint device entries).
* When either of these happens, defer the Set-Interface.
*/
- if (!error && intf->dev.power.status == DPM_ON)
+ if (intf->cur_altsetting->desc.bAlternateSetting == 0)
+ ; /* Already in altsetting 0 so skip Set-Interface */
+ else if (!error && intf->dev.power.status == DPM_ON)
usb_set_interface(udev, intf->altsetting[0].
desc.bInterfaceNumber, 0);
else