The QH_MAXNUM is used in absolutelly incorrect manner and is not
even needed. Remove it and correctly replace it's occurance with
2 * NUM_ENDPOINTS .

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Fabio Estevam <fabio.este...@freescale.com>
Cc: Lei Wen <lei...@marvell.com>
Cc: Otavio Salvador <ota...@ossystems.com.br>
Cc: Stefano Babic <sba...@denx.de>
---
 drivers/usb/gadget/mv_udc.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index 5b2c16a..04e46e1 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -60,7 +60,7 @@ static const char *reqname(unsigned r)
 #endif
 
 #define PAGE_SIZE      4096
-#define QH_MAXNUM      32
+
 static struct usb_endpoint_descriptor ep0_out_desc = {
        .bLength = sizeof(struct usb_endpoint_descriptor),
        .bDescriptorType = USB_DT_ENDPOINT,
@@ -441,10 +441,11 @@ static int mvudc_probe(void)
 {
        struct ept_queue_head *head;
        int i;
+       const int num = 2 * NUM_ENDPOINTS;
 
        controller.gadget.ops = &mv_udc_ops;
-       epts = memalign(PAGE_SIZE, QH_MAXNUM * sizeof(struct ept_queue_head));
-       memset(epts, 0, QH_MAXNUM * sizeof(struct ept_queue_head));
+       epts = memalign(PAGE_SIZE, num * sizeof(struct ept_queue_head));
+       memset(epts, 0, num * sizeof(struct ept_queue_head));
        for (i = 0; i < 2 * NUM_ENDPOINTS; i++) {
                /*
                 * For item0 and item1, they are served as ep0
-- 
1.7.10.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to