mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 07:03:37 +02:00
USB: gadget: composite: Don't increment interface number for alt settings.
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
parent
6fd76fd99e
commit
b1d4000fe6
|
|
@ -322,8 +322,13 @@ static int config_buf(struct usb_configuration *config,
|
|||
dest = next;
|
||||
while ((descriptor = *descriptors++) != NULL) {
|
||||
intf = (struct usb_interface_descriptor *)dest;
|
||||
if (intf->bDescriptorType == USB_DT_INTERFACE)
|
||||
intf->bInterfaceNumber = interfaceCount++;
|
||||
if (intf->bDescriptorType == USB_DT_INTERFACE) {
|
||||
/* don't increment bInterfaceNumber for alternate settings */
|
||||
if (intf->bAlternateSetting == 0)
|
||||
intf->bInterfaceNumber = interfaceCount++;
|
||||
else
|
||||
intf->bInterfaceNumber = interfaceCount - 1;
|
||||
}
|
||||
dest += intf->bLength;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user