MLK-22357-3 usb: Clear the value of bEndpointAddress before refill it
authorSherry Sun <sherry.sun@nxp.com>
Wed, 31 Jul 2019 21:07:04 +0000 (17:07 -0400)
committerSherry Sun <sherry.sun@nxp.com>
Thu, 8 Aug 2019 17:12:57 +0000 (13:12 -0400)
For one usb controller driver, the transport endpoint address won't
change after the driver initialize. So the value of bEndpointAddress
have no need to be cleared.

But when more than one usb controller drivers are used at the same time,
different endpoints address is used by different controller driver
usually, it will cause confusion of endpoint address. So the value of
bEndpointAddress had better been cleared everytime before we refill
endpoint address to it.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
drivers/usb/gadget/epautoconf.c

index ca916b6..c908d55 100644 (file)
@@ -143,6 +143,7 @@ static int ep_matches(
        /* MATCH!! */
 
        /* report address */
+       desc->bEndpointAddress &= 0xF0;
        if (isdigit(ep->name[2])) {
                u8      num = simple_strtoul(&ep->name[2], NULL, 10);
                desc->bEndpointAddress |= num;