提交 382c1b38 编写于 作者: F Fabio Estevam 提交者: Peter Chen

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: NFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: NPeter Chen <peter.chen@nxp.com>
上级 c744a0db
......@@ -1677,12 +1677,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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册