au1000_eth: switch to dma_alloc_attrs

Use dma_alloc_attrs directly instead of the dma_alloc_noncoherent wrapper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Christoph Hellwig 2017-06-14 10:29:47 +02:00
parent d64bfe9f70
commit ae9f608f07

View File

@ -1180,9 +1180,10 @@ static int au1000_probe(struct platform_device *pdev)
/* Allocate the data buffers /* Allocate the data buffers
* Snooping works fine with eth on all au1xxx * Snooping works fine with eth on all au1xxx
*/ */
aup->vaddr = (u32)dma_alloc_noncoherent(NULL, MAX_BUF_SIZE * aup->vaddr = (u32)dma_alloc_attrs(NULL, MAX_BUF_SIZE *
(NUM_TX_BUFFS + NUM_RX_BUFFS), (NUM_TX_BUFFS + NUM_RX_BUFFS),
&aup->dma_addr, 0); &aup->dma_addr, 0,
DMA_ATTR_NON_CONSISTENT);
if (!aup->vaddr) { if (!aup->vaddr) {
dev_err(&pdev->dev, "failed to allocate data buffers\n"); dev_err(&pdev->dev, "failed to allocate data buffers\n");
err = -ENOMEM; err = -ENOMEM;
@ -1361,8 +1362,9 @@ err_remap3:
err_remap2: err_remap2:
iounmap(aup->mac); iounmap(aup->mac);
err_remap1: err_remap1:
dma_free_noncoherent(NULL, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS), dma_free_attrs(NULL, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
(void *)aup->vaddr, aup->dma_addr); (void *)aup->vaddr, aup->dma_addr,
DMA_ATTR_NON_CONSISTENT);
err_vaddr: err_vaddr:
free_netdev(dev); free_netdev(dev);
err_alloc: err_alloc:
@ -1394,9 +1396,9 @@ static int au1000_remove(struct platform_device *pdev)
if (aup->tx_db_inuse[i]) if (aup->tx_db_inuse[i])
au1000_ReleaseDB(aup, aup->tx_db_inuse[i]); au1000_ReleaseDB(aup, aup->tx_db_inuse[i]);
dma_free_noncoherent(NULL, MAX_BUF_SIZE * dma_free_attrs(NULL, MAX_BUF_SIZE * (NUM_TX_BUFFS + NUM_RX_BUFFS),
(NUM_TX_BUFFS + NUM_RX_BUFFS), (void *)aup->vaddr, aup->dma_addr,
(void *)aup->vaddr, aup->dma_addr); DMA_ATTR_NON_CONSISTENT);
iounmap(aup->macdma); iounmap(aup->macdma);
iounmap(aup->mac); iounmap(aup->mac);