]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: gadget: fastboot: use correct max packet size
authorLi Jun <jun.li@nxp.com>
Mon, 25 Jan 2021 13:43:59 +0000 (21:43 +0800)
committerMarek Vasut <marex@denx.de>
Sun, 31 Jan 2021 13:08:56 +0000 (14:08 +0100)
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

index f3ce47a0d2a4c2166f8d72bf36e714b6c21c4012..950cc119495ec0b24112aeba2c67c436456e4ee4 100644 (file)
@@ -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;