diff options
author | Souptick Joarder <jrdr.linux@gmail.com> | 2016-11-29 15:58:58 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-11-29 22:20:40 -0500 |
commit | c2e60fc702db68029e32c1fe00a9683dcb29316b (patch) | |
tree | fcc6d122c95331fb01c5fd86c490539a9d9eb7da | |
parent | d6481608638946d8eeb91d7a19ad9ccd9e58a5c4 (diff) |
dmaengine: zx296702_dma: Use dma_pool_zalloc
We should use dma_pool_zalloc instead of dma_pool_alloc/memset.
Signed-off-by: Souptick joarder <jrdr.linux@gmail.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/zx296702_dma.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/dma/zx296702_dma.c b/drivers/dma/zx296702_dma.c index 245d759d5ffc..380276d078b2 100644 --- a/drivers/dma/zx296702_dma.c +++ b/drivers/dma/zx296702_dma.c | |||
@@ -435,13 +435,12 @@ static struct zx_dma_desc_sw *zx_alloc_desc_resource(int num, | |||
435 | if (!ds) | 435 | if (!ds) |
436 | return NULL; | 436 | return NULL; |
437 | 437 | ||
438 | ds->desc_hw = dma_pool_alloc(d->pool, GFP_NOWAIT, &ds->desc_hw_lli); | 438 | ds->desc_hw = dma_pool_zalloc(d->pool, GFP_NOWAIT, &ds->desc_hw_lli); |
439 | if (!ds->desc_hw) { | 439 | if (!ds->desc_hw) { |
440 | dev_dbg(chan->device->dev, "vch %p: dma alloc fail\n", &c->vc); | 440 | dev_dbg(chan->device->dev, "vch %p: dma alloc fail\n", &c->vc); |
441 | kfree(ds); | 441 | kfree(ds); |
442 | return NULL; | 442 | return NULL; |
443 | } | 443 | } |
444 | memset(ds->desc_hw, 0, sizeof(struct zx_desc_hw) * num); | ||
445 | ds->desc_num = num; | 444 | ds->desc_num = num; |
446 | return ds; | 445 | return ds; |
447 | } | 446 | } |