Commit 1f55c286 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller

wan/fsl_ucc_hdlc: use dma_zalloc_coherent instead of allocator/memset

Use dma_zalloc_coherent instead of dma_alloc_coherent
followed by memset 0.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 828da432
...@@ -270,7 +270,7 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) ...@@ -270,7 +270,7 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr4); iowrite16be(DEFAULT_HDLC_ADDR, &priv->ucc_pram->haddr4);
/* Get BD buffer */ /* Get BD buffer */
bd_buffer = dma_alloc_coherent(priv->dev, bd_buffer = dma_zalloc_coherent(priv->dev,
(RX_BD_RING_LEN + TX_BD_RING_LEN) * (RX_BD_RING_LEN + TX_BD_RING_LEN) *
MAX_RX_BUF_LENGTH, MAX_RX_BUF_LENGTH,
&bd_dma_addr, GFP_KERNEL); &bd_dma_addr, GFP_KERNEL);
...@@ -281,9 +281,6 @@ static int uhdlc_init(struct ucc_hdlc_private *priv) ...@@ -281,9 +281,6 @@ static int uhdlc_init(struct ucc_hdlc_private *priv)
goto free_tiptr; goto free_tiptr;
} }
memset(bd_buffer, 0, (RX_BD_RING_LEN + TX_BD_RING_LEN)
* MAX_RX_BUF_LENGTH);
priv->rx_buffer = bd_buffer; priv->rx_buffer = bd_buffer;
priv->tx_buffer = bd_buffer + RX_BD_RING_LEN * MAX_RX_BUF_LENGTH; priv->tx_buffer = bd_buffer + RX_BD_RING_LEN * MAX_RX_BUF_LENGTH;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment