usb: musb: Use ARRAY_SIZE at appropriate places
authorAxel Lin <axel.lin@ingics.com>
Sat, 22 Jun 2013 16:57:46 +0000 (00:57 +0800)
committerTom Rini <trini@ti.com>
Wed, 26 Jun 2013 14:26:06 +0000 (10:26 -0400)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
drivers/usb/musb/musb_hcd.c
drivers/usb/musb/musb_udc.c

index 60e03a4bf73a5d755a5d68f05b8198b4600746e8..7bb91e5abfe859b2d13aa307263f71dca9200e4d 100644 (file)
@@ -1105,8 +1105,7 @@ int usb_lowlevel_init(int index, void **controller)
 
        /* Configure all the endpoint FIFO's and start usb controller */
        musbr = musb_cfg.regs;
-       musb_configure_ep(&epinfo[0],
-                       sizeof(epinfo) / sizeof(struct musb_epinfo));
+       musb_configure_ep(&epinfo[0], ARRAY_SIZE(epinfo));
        musb_start();
 
        /*
index e0b4217dc3f5060c1fe8d2489f452722d804b003..e8a2ce0419478e87ac60c1f6830a4643b2badf2b 100644 (file)
@@ -894,8 +894,7 @@ void udc_setup_ep(struct usb_device_instance *device, unsigned int id,
                        epinfo[id * 2].epsize = endpoint->rcv_packetSize;
                }
 
-               musb_configure_ep(&epinfo[0],
-                                 sizeof(epinfo) / sizeof(struct musb_epinfo));
+               musb_configure_ep(&epinfo[0], ARRAY_SIZE(epinfo));
        } else {
                if (debug_level > 0)
                        serial_printf("ERROR : %s endpoint request %d "