diff options
-rw-r--r-- | drivers/usb/core/hcd.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 80995ef0868..cf0a098a543 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1670,11 +1670,16 @@ int usb_hcd_alloc_bandwidth(struct usb_device *udev, | |||
1670 | } | 1670 | } |
1671 | } | 1671 | } |
1672 | for (i = 0; i < num_intfs; ++i) { | 1672 | for (i = 0; i < num_intfs; ++i) { |
1673 | struct usb_host_interface *first_alt; | ||
1674 | int iface_num; | ||
1675 | |||
1676 | first_alt = &new_config->intf_cache[i]->altsetting[0]; | ||
1677 | iface_num = first_alt->desc.bInterfaceNumber; | ||
1673 | /* Set up endpoints for alternate interface setting 0 */ | 1678 | /* Set up endpoints for alternate interface setting 0 */ |
1674 | alt = usb_find_alt_setting(new_config, i, 0); | 1679 | alt = usb_find_alt_setting(new_config, iface_num, 0); |
1675 | if (!alt) | 1680 | if (!alt) |
1676 | /* No alt setting 0? Pick the first setting. */ | 1681 | /* No alt setting 0? Pick the first setting. */ |
1677 | alt = &new_config->intf_cache[i]->altsetting[0]; | 1682 | alt = first_alt; |
1678 | 1683 | ||
1679 | for (j = 0; j < alt->desc.bNumEndpoints; j++) { | 1684 | for (j = 0; j < alt->desc.bNumEndpoints; j++) { |
1680 | ret = hcd->driver->add_endpoint(hcd, udev, &alt->endpoint[j]); | 1685 | ret = hcd->driver->add_endpoint(hcd, udev, &alt->endpoint[j]); |