mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09: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:
committed by
Colin Cross
parent
8c6a6b2180
commit
0f63be2175
@@ -326,8 +326,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user