dmaengine: k3dma: move to dma_pool_zalloc
authorVinod Koul <vinod.koul@intel.com>
Wed, 7 Dec 2016 04:06:22 +0000 (09:36 +0530)
committerVinod Koul <vinod.koul@intel.com>
Thu, 8 Dec 2016 15:54:21 +0000 (21:24 +0530)
Replace dma_pool_alloc & memset with dma_pool_zalloc.

Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/k3dma.c

index aabcb79..01e25c6 100644 (file)
@@ -458,13 +458,12 @@ static struct k3_dma_desc_sw *k3_dma_alloc_desc_resource(int num,
        if (!ds)
                return NULL;
 
-       ds->desc_hw = dma_pool_alloc(d->pool, GFP_NOWAIT, &ds->desc_hw_lli);
+       ds->desc_hw = dma_pool_zalloc(d->pool, GFP_NOWAIT, &ds->desc_hw_lli);
        if (!ds->desc_hw) {
                dev_dbg(chan->device->dev, "vch %p: dma alloc fail\n", &c->vc);
                kfree(ds);
                return NULL;
        }
-       memset(ds->desc_hw, 0, sizeof(struct k3_desc_hw) * num);
        ds->desc_num = num;
        return ds;
 }