diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2007-02-08 16:40:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-02-16 15:32:21 -0800 |
commit | 3f141e2aed586c41c2666d49c70c1c1bbb6d6abd (patch) | |
tree | d7308c465ec658fd09b5f6969ccf8a8e9b48f131 /drivers/usb/core/devio.c | |
parent | d1bbb60007597b920beca72cd0b413d10290310a (diff) | |
download | linux-stable-3f141e2aed586c41c2666d49c70c1c1bbb6d6abd.tar.gz linux-stable-3f141e2aed586c41c2666d49c70c1c1bbb6d6abd.tar.bz2 linux-stable-3f141e2aed586c41c2666d49c70c1c1bbb6d6abd.zip |
USB: unconfigure devices which have config 0
Some USB devices do have a configuration 0, in contravention of the
USB spec. Normally 0 is supposed to indicate that a device is
unconfigured.
While we can't change what the device is doing, we can change usbcore.
This patch (as852) allows usb_set_configuration() to accept a config
value of -1 as indicating that the device should be unconfigured. The
request actually sent to the device will still contain 0 as the value.
But even if the device does have a configuration 0, dev->actconfig
will be set to NULL and dev->state will be set to USB_STATE_ADDRESS.
Without some sort of special-case handling like this, there is no way
to unconfigure these non-compliant devices.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r-- | drivers/usb/core/devio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 2087766f9e88..274f14f1633e 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -857,11 +857,11 @@ static int proc_setintf(struct dev_state *ps, void __user *arg) static int proc_setconfig(struct dev_state *ps, void __user *arg) { - unsigned int u; + int u; int status = 0; struct usb_host_config *actconfig; - if (get_user(u, (unsigned int __user *)arg)) + if (get_user(u, (int __user *)arg)) return -EFAULT; actconfig = ps->dev->actconfig; |