From: Fabio Estevam <[email protected]>

We can make the code simpler by using dma_pool_zalloc() instead
of calling dma_pool_alloc() followed by memset().

Signed-off-by: Fabio Estevam <[email protected]>
---
Changes since v1:
- Fix a typo in commit log (Sergei)

 drivers/usb/chipidea/udc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 0f692fc..f24d922 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1668,12 +1668,10 @@ static int init_eps(struct ci_hdrc *ci)
                        usb_ep_set_maxpacket_limit(&hwep->ep, (unsigned 
short)~0);
 
                        INIT_LIST_HEAD(&hwep->qh.queue);
-                       hwep->qh.ptr = dma_pool_alloc(ci->qh_pool, GFP_KERNEL,
-                                                    &hwep->qh.dma);
+                       hwep->qh.ptr = dma_pool_zalloc(ci->qh_pool, GFP_KERNEL,
+                                                      &hwep->qh.dma);
                        if (hwep->qh.ptr == NULL)
                                retval = -ENOMEM;
-                       else
-                               memset(hwep->qh.ptr, 0, sizeof(*hwep->qh.ptr));
 
                        /*
                         * set up shorthands for ep0 out and in endpoints,
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to