Skip to content

Commit

Permalink
net: ocelot: use dma_unmap_addr to get tx buffer dma_addr
Browse files Browse the repository at this point in the history
dma_addr was declared using DEFINE_DMA_UNMAP_ADDR() which requires to
use dma_unmap_addr() to access it.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 753a026 ("net: ocelot: add FDMA support")
Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Clément Léger authored and David S. Miller committed Dec 13, 2021
1 parent b26980a commit 3cfcda2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mscc/ocelot_fdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,8 @@ static void ocelot_fdma_free_tx_ring(struct ocelot *ocelot)
while (idx != tx_ring->next_to_use) {
txb = &tx_ring->bufs[idx];
skb = txb->skb;
dma_unmap_single(ocelot->dev, txb->dma_addr, skb->len,
DMA_TO_DEVICE);
dma_unmap_single(ocelot->dev, dma_unmap_addr(txb, dma_addr),
skb->len, DMA_TO_DEVICE);
dev_kfree_skb_any(skb);
idx = ocelot_fdma_idx_next(idx, OCELOT_FDMA_TX_RING_SIZE);
}
Expand Down

0 comments on commit 3cfcda2

Please sign in to comment.