summaryrefslogtreecommitdiff
path: root/drivers/staging/mt7621-eth
diff options
context:
space:
mode:
authorzhong jiang <zhongjiang@huawei.com>2018-08-01 22:10:15 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-01 20:00:53 +0200
commit5298ff58c93e0d7b7d67b8525e7c18a9478cbd8d (patch)
tree48af8056cb55b6429fef0840619310ccfaf22eb4 /drivers/staging/mt7621-eth
parent500cc548c8ebe7494ba37673c3ec1faa342858c3 (diff)
drivers/staging/mt7621-eth: Use dma_zalloc_coherent to replace dma_alloc_coherent+memset
we prefer to use dma_zalloc_coherent rather than dam_alloc_coherent+memset Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-eth')
-rw-r--r--drivers/staging/mt7621-eth/mtk_eth_soc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/mt7621-eth/mtk_eth_soc.c b/drivers/staging/mt7621-eth/mtk_eth_soc.c
index f9b593ca2bcf..713507558568 100644
--- a/drivers/staging/mt7621-eth/mtk_eth_soc.c
+++ b/drivers/staging/mt7621-eth/mtk_eth_soc.c
@@ -1396,14 +1396,13 @@ static int mtk_qdma_tx_alloc_tx(struct mtk_eth *eth)
if (!ring->tx_buf)
goto no_tx_mem;
- ring->tx_dma = dma_alloc_coherent(eth->dev,
+ ring->tx_dma = dma_zalloc_coherent(eth->dev,
ring->tx_ring_size * sz,
&ring->tx_phys,
GFP_ATOMIC | __GFP_ZERO);
if (!ring->tx_dma)
goto no_tx_mem;
- memset(ring->tx_dma, 0, ring->tx_ring_size * sz);
for (i = 0; i < ring->tx_ring_size; i++) {
int next = (i + 1) % ring->tx_ring_size;
u32 next_ptr = ring->tx_phys + next * sz;