USB: skip Set-Interface(0) if already in altsetting 0
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 1 Dec 2008 15:24:41 +0000 (10:24 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 17 Dec 2008 18:49:14 +0000 (10:49 -0800)
commit24c0996a6b73e2554104961afcc8659534503e0d
treece806aca4dbe0b236a639a9067615594f8cdedf6
parent9a9fafb89433c5fd1331bac0c84c4b321e358b42
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>
drivers/usb/core/driver.c