diff options
Diffstat (limited to 'drivers/usb/core/message.c')
-rw-r--r-- | drivers/usb/core/message.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 08d95e9d56c2..3cdcd0a2c0b7 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -1293,8 +1293,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate) | |||
1293 | struct usb_interface *iface; | 1293 | struct usb_interface *iface; |
1294 | struct usb_host_interface *alt; | 1294 | struct usb_host_interface *alt; |
1295 | struct usb_hcd *hcd = bus_to_hcd(dev->bus); | 1295 | struct usb_hcd *hcd = bus_to_hcd(dev->bus); |
1296 | int ret; | 1296 | int i, ret, manual = 0; |
1297 | int manual = 0; | ||
1298 | unsigned int epaddr; | 1297 | unsigned int epaddr; |
1299 | unsigned int pipe; | 1298 | unsigned int pipe; |
1300 | 1299 | ||
@@ -1329,6 +1328,10 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate) | |||
1329 | mutex_unlock(hcd->bandwidth_mutex); | 1328 | mutex_unlock(hcd->bandwidth_mutex); |
1330 | return -ENOMEM; | 1329 | return -ENOMEM; |
1331 | } | 1330 | } |
1331 | /* Changing alt-setting also frees any allocated streams */ | ||
1332 | for (i = 0; i < iface->cur_altsetting->desc.bNumEndpoints; i++) | ||
1333 | iface->cur_altsetting->endpoint[i].streams = 0; | ||
1334 | |||
1332 | ret = usb_hcd_alloc_bandwidth(dev, NULL, iface->cur_altsetting, alt); | 1335 | ret = usb_hcd_alloc_bandwidth(dev, NULL, iface->cur_altsetting, alt); |
1333 | if (ret < 0) { | 1336 | if (ret < 0) { |
1334 | dev_info(&dev->dev, "Not enough bandwidth for altsetting %d\n", | 1337 | dev_info(&dev->dev, "Not enough bandwidth for altsetting %d\n", |