提交 84c816da 编写于 作者: D Djalal Harouni 提交者: John W. Linville

drivers/iwlwifi: use dma_zalloc_coherent() for DMA allocation

Replace dma_alloc_coherent()+memset() with the new dma_zalloc_coherent()
Signed-off-by: NDjalal Harouni <tixxdz@opendz.org>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 3dda07b6
...@@ -88,18 +88,16 @@ static int iwl_trans_rx_alloc(struct iwl_trans *trans) ...@@ -88,18 +88,16 @@ static int iwl_trans_rx_alloc(struct iwl_trans *trans)
return -EINVAL; return -EINVAL;
/* Allocate the circular buffer of Read Buffer Descriptors (RBDs) */ /* Allocate the circular buffer of Read Buffer Descriptors (RBDs) */
rxq->bd = dma_alloc_coherent(dev, sizeof(__le32) * RX_QUEUE_SIZE, rxq->bd = dma_zalloc_coherent(dev, sizeof(__le32) * RX_QUEUE_SIZE,
&rxq->bd_dma, GFP_KERNEL); &rxq->bd_dma, GFP_KERNEL);
if (!rxq->bd) if (!rxq->bd)
goto err_bd; goto err_bd;
memset(rxq->bd, 0, sizeof(__le32) * RX_QUEUE_SIZE);
/*Allocate the driver's pointer to receive buffer status */ /*Allocate the driver's pointer to receive buffer status */
rxq->rb_stts = dma_alloc_coherent(dev, sizeof(*rxq->rb_stts), rxq->rb_stts = dma_zalloc_coherent(dev, sizeof(*rxq->rb_stts),
&rxq->rb_stts_dma, GFP_KERNEL); &rxq->rb_stts_dma, GFP_KERNEL);
if (!rxq->rb_stts) if (!rxq->rb_stts)
goto err_rb_stts; goto err_rb_stts;
memset(rxq->rb_stts, 0, sizeof(*rxq->rb_stts));
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册