summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2013-07-10 03:16:34 +0200
committerMarek Vasut <marex@denx.de>2013-07-29 23:01:32 +0200
commitf646317739592a67847e0707c5e1072bfafaba7a (patch)
tree1ba68383f78aeeb96b480293303620c2c2e4c6d7 /drivers/usb
parentd76630386d59d203ad4594d7e91be1f2e258ab93 (diff)
usb: mv_udc: Remove QH_MAXNUM macro
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 <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Lei Wen <leiwen@marvell.com> Cc: Otavio Salvador <otavio@ossystems.com.br> Cc: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/mv_udc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index bed589820a..210373ddde 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -44,7 +44,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,
@@ -425,10 +425,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