aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-rx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index 428c9d689d4c..aba8f4c20c1b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -345,10 +345,10 @@ void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
345 } 345 }
346 } 346 }
347 347
348 pci_free_consistent(priv->pci_dev, 4 * RX_QUEUE_SIZE, rxq->bd, 348 dma_free_coherent(&priv->pci_dev->dev, 4 * RX_QUEUE_SIZE, rxq->bd,
349 rxq->dma_addr); 349 rxq->dma_addr);
350 pci_free_consistent(priv->pci_dev, sizeof(struct iwl_rb_status), 350 dma_free_coherent(&priv->pci_dev->dev, sizeof(struct iwl_rb_status),
351 rxq->rb_stts, rxq->rb_stts_dma); 351 rxq->rb_stts, rxq->rb_stts_dma);
352 rxq->bd = NULL; 352 rxq->bd = NULL;
353 rxq->rb_stts = NULL; 353 rxq->rb_stts = NULL;
354} 354}
@@ -357,7 +357,7 @@ EXPORT_SYMBOL(iwl_rx_queue_free);
357int iwl_rx_queue_alloc(struct iwl_priv *priv) 357int iwl_rx_queue_alloc(struct iwl_priv *priv)
358{ 358{
359 struct iwl_rx_queue *rxq = &priv->rxq; 359 struct iwl_rx_queue *rxq = &priv->rxq;
360 struct pci_dev *dev = priv->pci_dev; 360 struct device *dev = &priv->pci_dev->dev;
361 int i; 361 int i;
362 362
363 spin_lock_init(&rxq->lock); 363 spin_lock_init(&rxq->lock);
@@ -365,12 +365,13 @@ int iwl_rx_queue_alloc(struct iwl_priv *priv)
365 INIT_LIST_HEAD(&rxq->rx_used); 365 INIT_LIST_HEAD(&rxq->rx_used);
366 366
367 /* Alloc the circular buffer of Read Buffer Descriptors (RBDs) */ 367 /* Alloc the circular buffer of Read Buffer Descriptors (RBDs) */
368 rxq->bd = pci_alloc_consistent(dev, 4 * RX_QUEUE_SIZE, &rxq->dma_addr); 368 rxq->bd = dma_alloc_coherent(dev, 4 * RX_QUEUE_SIZE, &rxq->dma_addr,
369 GFP_KERNEL);
369 if (!rxq->bd) 370 if (!rxq->bd)
370 goto err_bd; 371 goto err_bd;
371 372
372 rxq->rb_stts = pci_alloc_consistent(dev, sizeof(struct iwl_rb_status), 373 rxq->rb_stts = dma_alloc_coherent(dev, sizeof(struct iwl_rb_status),
373 &rxq->rb_stts_dma); 374 &rxq->rb_stts_dma, GFP_KERNEL);
374 if (!rxq->rb_stts) 375 if (!rxq->rb_stts)
375 goto err_rb; 376 goto err_rb;
376 377
@@ -387,8 +388,8 @@ int iwl_rx_queue_alloc(struct iwl_priv *priv)
387 return 0; 388 return 0;
388 389
389err_rb: 390err_rb:
390 pci_free_consistent(priv->pci_dev, 4 * RX_QUEUE_SIZE, rxq->bd, 391 dma_free_coherent(&priv->pci_dev->dev, 4 * RX_QUEUE_SIZE, rxq->bd,
391 rxq->dma_addr); 392 rxq->dma_addr);
392err_bd: 393err_bd:
393 return -ENOMEM; 394 return -ENOMEM;
394} 395}