diff mbox series

[15/16] usb: gadget: fastboot: use correct max packet size

Message ID 20200916132537.8313-16-peng.fan@nxp.com
State Superseded
Headers show
Series usb: gadget: update | expand

Commit Message

Peng Fan Sept. 16, 2020, 1:25 p.m. UTC
From: Li Jun <jun.li@nxp.com>


Change to use wMaxPacketSize of current speed EP desc for request
length wrap up.

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/f_fastboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.28.0
diff mbox series

Patch

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index c2abdd66a8..2ef75a1388 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -427,7 +427,7 @@  static unsigned int rx_bytes_expected(struct usb_ep *ep)
 {
 	int rx_remain = fastboot_data_remaining();
 	unsigned int rem;
-	unsigned int maxpacket = ep->maxpacket;
+	unsigned int maxpacket = usb_endpoint_maxp(ep->desc);
 
 	if (rx_remain <= 0)
 		return 0;