summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Machon <daniel.machon@microchip.com>2024-09-05 11:06:37 +0300
committerPaolo Abeni <pabeni@redhat.com>2024-09-10 12:04:16 +0300
commit8cdd0bd02283036130396d70183c15a97f3be6b7 (patch)
treeea2064f6459c30c7199525d87cd939236e4fad8d /drivers
parent29cc3a66a81ddaa237a3fe3c14cf0fc582db25bf (diff)
downloadlinux-8cdd0bd02283036130396d70183c15a97f3be6b7.tar.xz
net: lan966x: use library helper for freeing tx buffers
The library has the helper fdma_free_phys() for freeing physical FDMA memory. Use it in the exit path. Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
index 1beafadce87a..6f7e3c27c1a7 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
@@ -229,14 +229,9 @@ out:
static void lan966x_fdma_tx_free(struct lan966x_tx *tx)
{
struct lan966x *lan966x = tx->lan966x;
- struct fdma *fdma = &tx->fdma;
- int size;
kfree(tx->dcbs_buf);
-
- size = sizeof(struct fdma_dcb) * fdma->n_dcbs;
- size = ALIGN(size, PAGE_SIZE);
- dma_free_coherent(lan966x->dev, size, fdma->dcbs, fdma->dma);
+ fdma_free_coherent(lan966x->dev, &tx->fdma);
}
static void lan966x_fdma_tx_activate(struct lan966x_tx *tx)