OSDN Git Service

powerpc/pasemi: Use dma_zalloc_coherent()
authorSabyasachi Gupta <sabyasachi.linux@gmail.com>
Mon, 5 Nov 2018 03:28:23 +0000 (08:58 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 25 Nov 2018 06:11:22 +0000 (17:11 +1100)
Replace dma_alloc_coherent() + memset() with dma_zalloc_coherent().

Signed-off-by: Sabyasachi Gupta <sabyasachi.linux@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/pasemi/dma_lib.c

index 53384eb..d18d164 100644 (file)
@@ -255,15 +255,13 @@ int pasemi_dma_alloc_ring(struct pasemi_dmachan *chan, int ring_size)
 
        chan->ring_size = ring_size;
 
-       chan->ring_virt = dma_alloc_coherent(&dma_pdev->dev,
+       chan->ring_virt = dma_zalloc_coherent(&dma_pdev->dev,
                                             ring_size * sizeof(u64),
                                             &chan->ring_dma, GFP_KERNEL);
 
        if (!chan->ring_virt)
                return -ENOMEM;
 
-       memset(chan->ring_virt, 0, ring_size * sizeof(u64));
-
        return 0;
 }
 EXPORT_SYMBOL(pasemi_dma_alloc_ring);