]> git.karo-electronics.de Git - linux-beck.git/commitdiff
usb: gadget: at91: fix the number of endpoint parameter
authorBo Shen <voice.shen@atmel.com>
Wed, 19 Feb 2014 02:07:43 +0000 (10:07 +0800)
committerFelipe Balbi <balbi@ti.com>
Wed, 19 Feb 2014 19:46:48 +0000 (13:46 -0600)
In sama5d3 SoC, there are 16 endpoints, which is different with
earlier SoCs (only have 7 endpoints). The USBA_NR_ENDPOINTS macro
is not suitable for sama5d3. So, get the endpoints number through
the udc->num_ep, which get from platform data for non-dt kernel,
or parse from dt node.

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/atmel_usba_udc.c

index 52771d4c44bc96c7974fd50e82f4256d02bc9dc2..53eea030fc15fe71a040289f829a764884cb7b26 100644 (file)
@@ -1670,7 +1670,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid)
        if (ep_status) {
                int i;
 
-               for (i = 0; i < USBA_NR_ENDPOINTS; i++)
+               for (i = 0; i < udc->num_ep; i++)
                        if (ep_status & (1 << i)) {
                                if (ep_is_control(&udc->usba_ep[i]))
                                        usba_control_irq(udc, &udc->usba_ep[i]);