[PATCH V2 17/17] usb: gaget: ci: set ep's desc when enable ep

peng.fan at nxp.com peng.fan at nxp.com
Mon Jan 25 14:44:00 CET 2021


From: Li Jun <jun.li at nxp.com>

As we need standard usb_ep's desc, so set it when enable ep.

Reviewed-by: Peter Chen <peter.chen at nxp.com>
Signed-off-by: Li Jun <jun.li at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 drivers/usb/gadget/ci_udc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c
index b64e4bb605..226a9e6d67 100644
--- a/drivers/usb/gadget/ci_udc.c
+++ b/drivers/usb/gadget/ci_udc.c
@@ -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;
 }
 
-- 
2.28.0



More information about the U-Boot mailing list