diff options
author | Saurabh Sengar <saurabh.truth@gmail.com> | 2015-10-28 03:14:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-01 17:26:33 -0500 |
commit | 84c1eeb02353ffcafe039e892410cad835334ba9 (patch) | |
tree | f8545cfc0a022bee95c1327bc1bd190207020bef /drivers/usb/chipidea | |
parent | ced08b020e6ce0fa693e4d1d8c6088dbc0a36c64 (diff) |
usb : replace dma_pool_alloc and memset with dma_pool_zalloc
replace dma_pool_alloc and memset with a single call to dma_pool_zalloc
Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea')
-rw-r--r-- | drivers/usb/chipidea/udc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index 391a1225b0ba..b292b454c77b 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c | |||
@@ -349,14 +349,13 @@ static int add_td_to_list(struct ci_hw_ep *hwep, struct ci_hw_req *hwreq, | |||
349 | if (node == NULL) | 349 | if (node == NULL) |
350 | return -ENOMEM; | 350 | return -ENOMEM; |
351 | 351 | ||
352 | node->ptr = dma_pool_alloc(hwep->td_pool, GFP_ATOMIC, | 352 | node->ptr = dma_pool_zalloc(hwep->td_pool, GFP_ATOMIC, |
353 | &node->dma); | 353 | &node->dma); |
354 | if (node->ptr == NULL) { | 354 | if (node->ptr == NULL) { |
355 | kfree(node); | 355 | kfree(node); |
356 | return -ENOMEM; | 356 | return -ENOMEM; |
357 | } | 357 | } |
358 | 358 | ||
359 | memset(node->ptr, 0, sizeof(struct ci_hw_td)); | ||
360 | node->ptr->token = cpu_to_le32(length << __ffs(TD_TOTAL_BYTES)); | 359 | node->ptr->token = cpu_to_le32(length << __ffs(TD_TOTAL_BYTES)); |
361 | node->ptr->token &= cpu_to_le32(TD_TOTAL_BYTES); | 360 | node->ptr->token &= cpu_to_le32(TD_TOTAL_BYTES); |
362 | node->ptr->token |= cpu_to_le32(TD_STATUS_ACTIVE); | 361 | node->ptr->token |= cpu_to_le32(TD_STATUS_ACTIVE); |