summaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/farsync.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index fe4650260bc6..087c21b39b8d 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2553,16 +2553,16 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
* Allocate a dma buffer for transmit and receives
*/
card->rx_dma_handle_host =
- pci_alloc_consistent(card->device, FST_MAX_MTU,
- &card->rx_dma_handle_card);
+ dma_alloc_coherent(&card->device->dev, FST_MAX_MTU,
+ &card->rx_dma_handle_card, GFP_KERNEL);
if (card->rx_dma_handle_host == NULL) {
pr_err("Could not allocate rx dma buffer\n");
err = -ENOMEM;
goto rx_dma_fail;
}
card->tx_dma_handle_host =
- pci_alloc_consistent(card->device, FST_MAX_MTU,
- &card->tx_dma_handle_card);
+ dma_alloc_coherent(&card->device->dev, FST_MAX_MTU,
+ &card->tx_dma_handle_card, GFP_KERNEL);
if (card->tx_dma_handle_host == NULL) {
pr_err("Could not allocate tx dma buffer\n");
err = -ENOMEM;
@@ -2572,9 +2572,8 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0; /* Success */
tx_dma_fail:
- pci_free_consistent(card->device, FST_MAX_MTU,
- card->rx_dma_handle_host,
- card->rx_dma_handle_card);
+ dma_free_coherent(&card->device->dev, FST_MAX_MTU,
+ card->rx_dma_handle_host, card->rx_dma_handle_card);
rx_dma_fail:
fst_disable_intr(card);
for (i = 0 ; i < card->nports ; i++)
@@ -2625,12 +2624,12 @@ fst_remove_one(struct pci_dev *pdev)
/*
* Free dma buffers
*/
- pci_free_consistent(card->device, FST_MAX_MTU,
- card->rx_dma_handle_host,
- card->rx_dma_handle_card);
- pci_free_consistent(card->device, FST_MAX_MTU,
- card->tx_dma_handle_host,
- card->tx_dma_handle_card);
+ dma_free_coherent(&card->device->dev, FST_MAX_MTU,
+ card->rx_dma_handle_host,
+ card->rx_dma_handle_card);
+ dma_free_coherent(&card->device->dev, FST_MAX_MTU,
+ card->tx_dma_handle_host,
+ card->tx_dma_handle_card);
}
fst_card_array[card->card_no] = NULL;
}