]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: gaget: ci: set ep's desc when enable ep
authorLi Jun <jun.li@nxp.com>
Mon, 25 Jan 2021 13:44:00 +0000 (21:44 +0800)
committerMarek Vasut <marex@denx.de>
Sun, 31 Jan 2021 13:08:56 +0000 (14:08 +0100)
As we need standard usb_ep's desc, so set it when enable ep.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/usb/gadget/ci_udc.c

index b64e4bb605d6576ac866bdda7b2f7831adc4288f..226a9e6d671edb954a5dd9fdbd8509e489cdfdd0 100644 (file)
@@ -336,6 +336,7 @@ static int ci_ep_enable(struct usb_ep *ep,
        num = desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
        in = (desc->bEndpointAddress & USB_DIR_IN) != 0;
        ci_ep->desc = desc;
+       ep->desc = desc;
 
        if (num) {
                int max = get_unaligned_le16(&desc->wMaxPacketSize);
@@ -358,6 +359,7 @@ static int ci_ep_disable(struct usb_ep *ep)
        struct ci_ep *ci_ep = container_of(ep, struct ci_ep, ep);
 
        ci_ep->desc = NULL;
+       ep->desc = NULL;
        return 0;
 }