aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2019-08-07 16:50:51 +0200
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2019-08-27 10:31:06 +0200
commitd143a0a4f60e91861fe67dbff572b7b373c5abc4 (patch)
tree597646cb40a01ab2d6a77b4986790c6a7690bc98 /target/linux
parent42b42d2c9bd19b102663c1598b180dde4833320c (diff)
downloadupstream-d143a0a4f60e91861fe67dbff572b7b373c5abc4.tar.gz
upstream-d143a0a4f60e91861fe67dbff572b7b373c5abc4.tar.bz2
upstream-d143a0a4f60e91861fe67dbff572b7b373c5abc4.zip
ar71xx: ag71xx: pass correct device pointer to dma functions
Backport of 4eaa3626a821 ("ath79: ag71xx: pass correct device pointer to dma functions") While 4.14 does not contain the warnings, it still makes sense to use the proper pointers here. Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index 484f0ee71d..98c6b92c7d 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
@@ -159,7 +159,7 @@ static void ag71xx_ring_rx_clean(struct ag71xx *ag)
for (i = 0; i < ring_size; i++)
if (ring->buf[i].rx_buf) {
- dma_unmap_single(&ag->dev->dev, ring->buf[i].dma_addr,
+ dma_unmap_single(&ag->pdev->dev, ring->buf[i].dma_addr,
ag->rx_buf_size, DMA_FROM_DEVICE);
skb_free_frag(ring->buf[i].rx_buf);
}
@@ -200,7 +200,7 @@ static bool ag71xx_fill_rx_buf(struct ag71xx *ag, struct ag71xx_buf *buf,
return false;
buf->rx_buf = data;
- buf->dma_addr = dma_map_single(&ag->dev->dev, data, ag->rx_buf_size,
+ buf->dma_addr = dma_map_single(&ag->pdev->dev, data, ag->rx_buf_size,
DMA_FROM_DEVICE);
desc->data = (u32) buf->dma_addr + offset;
return true;
@@ -290,7 +290,7 @@ static int ag71xx_rings_init(struct ag71xx *ag)
if (!tx->buf)
return -ENOMEM;
- tx->descs_cpu = dma_alloc_coherent(NULL, ring_size * AG71XX_DESC_SIZE,
+ tx->descs_cpu = dma_alloc_coherent(&ag->pdev->dev, ring_size * AG71XX_DESC_SIZE,
&tx->descs_dma, GFP_KERNEL);
if (!tx->descs_cpu) {
kfree(tx->buf);
@@ -313,7 +313,7 @@ static void ag71xx_rings_free(struct ag71xx *ag)
int ring_size = BIT(tx->order) + BIT(rx->order);
if (tx->descs_cpu)
- dma_free_coherent(NULL, ring_size * AG71XX_DESC_SIZE,
+ dma_free_coherent(&ag->pdev->dev, ring_size * AG71XX_DESC_SIZE,
tx->descs_cpu, tx->descs_dma);
kfree(tx->buf);
@@ -785,7 +785,7 @@ static netdev_tx_t ag71xx_hard_start_xmit(struct sk_buff *skb,
goto err_drop;
}
- dma_addr = dma_map_single(&dev->dev, skb->data, skb->len,
+ dma_addr = dma_map_single(&ag->pdev->dev, skb->data, skb->len,
DMA_TO_DEVICE);
i = ring->curr & ring_mask;
@@ -827,7 +827,7 @@ static netdev_tx_t ag71xx_hard_start_xmit(struct sk_buff *skb,
return NETDEV_TX_OK;
err_drop_unmap:
- dma_unmap_single(&dev->dev, dma_addr, skb->len, DMA_TO_DEVICE);
+ dma_unmap_single(&ag->pdev->dev, dma_addr, skb->len, DMA_TO_DEVICE);
err_drop:
dev->stats.tx_dropped++;
@@ -1100,7 +1100,7 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
pktlen = desc->ctrl & pktlen_mask;
pktlen -= ETH_FCS_LEN;
- dma_unmap_single(&dev->dev, ring->buf[i].dma_addr,
+ dma_unmap_single(&ag->pdev->dev, ring->buf[i].dma_addr,
ag->rx_buf_size, DMA_FROM_DEVICE);
dev->stats.rx_packets++;