aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/chipidea/udc.c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@nxp.com>2016-09-08 08:34:30 -0400
committerPeter Chen <peter.chen@nxp.com>2016-09-13 22:58:13 -0400
commit382c1b38d8e70b2fe239c96bb9137c10f3229ba3 (patch)
tree28ba3fcbcfa2fc8e34e78cecf66080a568b1f4d0 /drivers/usb/chipidea/udc.c
parentc744a0db756b34c7e2b60100bcfc58beb6b68c99 (diff)
usb: chipidea: udc: Use dma_pool_zalloc()
We can make the code simpler by using dma_pool_zalloc() instead of calling dma_pool_alloc() and then a memset(). Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com>
Diffstat (limited to 'drivers/usb/chipidea/udc.c')
-rw-r--r--drivers/usb/chipidea/udc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index c1eea62ab998..a0b208dfb959 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -1677,12 +1677,10 @@ static int init_eps(struct ci_hdrc *ci)
1677 usb_ep_set_maxpacket_limit(&hwep->ep, (unsigned short)~0); 1677 usb_ep_set_maxpacket_limit(&hwep->ep, (unsigned short)~0);
1678 1678
1679 INIT_LIST_HEAD(&hwep->qh.queue); 1679 INIT_LIST_HEAD(&hwep->qh.queue);
1680 hwep->qh.ptr = dma_pool_alloc(ci->qh_pool, GFP_KERNEL, 1680 hwep->qh.ptr = dma_pool_zalloc(ci->qh_pool, GFP_KERNEL,
1681 &hwep->qh.dma); 1681 &hwep->qh.dma);
1682 if (hwep->qh.ptr == NULL) 1682 if (hwep->qh.ptr == NULL)
1683 retval = -ENOMEM; 1683 retval = -ENOMEM;
1684 else
1685 memset(hwep->qh.ptr, 0, sizeof(*hwep->qh.ptr));
1686 1684
1687 /* 1685 /*
1688 * set up shorthands for ep0 out and in endpoints, 1686 * set up shorthands for ep0 out and in endpoints,