diff options
author | Kedareswara rao Appana <appana.durga.rao@xilinx.com> | 2016-05-18 03:47:31 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2016-06-07 02:18:24 -0400 |
commit | 62147866517b3c2b22f52adec2b21bf97ce1e684 (patch) | |
tree | d8549c427a0a9d823a1e30c14d86463aa11830e0 | |
parent | 92d794dfb699bd7243d9f56656cc1850a48b9f04 (diff) |
dmaengine: vdma: Use dma_pool_zalloc
dma_pool_zalloc combines dma_pool_alloc and memset 0
this patch updates the driver to use dma_pool_zalloc.
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/xilinx/xilinx_vdma.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/dma/xilinx/xilinx_vdma.c b/drivers/dma/xilinx/xilinx_vdma.c index 3edd4544478a..0f5b38a0e46f 100644 --- a/drivers/dma/xilinx/xilinx_vdma.c +++ b/drivers/dma/xilinx/xilinx_vdma.c | |||
@@ -498,11 +498,10 @@ xilinx_cdma_alloc_tx_segment(struct xilinx_dma_chan *chan) | |||
498 | struct xilinx_cdma_tx_segment *segment; | 498 | struct xilinx_cdma_tx_segment *segment; |
499 | dma_addr_t phys; | 499 | dma_addr_t phys; |
500 | 500 | ||
501 | segment = dma_pool_alloc(chan->desc_pool, GFP_ATOMIC, &phys); | 501 | segment = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &phys); |
502 | if (!segment) | 502 | if (!segment) |
503 | return NULL; | 503 | return NULL; |
504 | 504 | ||
505 | memset(segment, 0, sizeof(*segment)); | ||
506 | segment->phys = phys; | 505 | segment->phys = phys; |
507 | 506 | ||
508 | return segment; | 507 | return segment; |
@@ -520,11 +519,10 @@ xilinx_axidma_alloc_tx_segment(struct xilinx_dma_chan *chan) | |||
520 | struct xilinx_axidma_tx_segment *segment; | 519 | struct xilinx_axidma_tx_segment *segment; |
521 | dma_addr_t phys; | 520 | dma_addr_t phys; |
522 | 521 | ||
523 | segment = dma_pool_alloc(chan->desc_pool, GFP_ATOMIC, &phys); | 522 | segment = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &phys); |
524 | if (!segment) | 523 | if (!segment) |
525 | return NULL; | 524 | return NULL; |
526 | 525 | ||
527 | memset(segment, 0, sizeof(*segment)); | ||
528 | segment->phys = phys; | 526 | segment->phys = phys; |
529 | 527 | ||
530 | return segment; | 528 | return segment; |