Commit 8cdd0bd0 authored by Daniel Machon's avatar Daniel Machon Committed by Paolo Abeni

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: default avatarDaniel Machon <daniel.machon@microchip.com>
Reviewed-by: default avatarHoratiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 29cc3a66
...@@ -229,14 +229,9 @@ static int lan966x_fdma_tx_alloc(struct lan966x_tx *tx) ...@@ -229,14 +229,9 @@ static int lan966x_fdma_tx_alloc(struct lan966x_tx *tx)
static void lan966x_fdma_tx_free(struct lan966x_tx *tx) static void lan966x_fdma_tx_free(struct lan966x_tx *tx)
{ {
struct lan966x *lan966x = tx->lan966x; struct lan966x *lan966x = tx->lan966x;
struct fdma *fdma = &tx->fdma;
int size;
kfree(tx->dcbs_buf); kfree(tx->dcbs_buf);
fdma_free_coherent(lan966x->dev, &tx->fdma);
size = sizeof(struct fdma_dcb) * fdma->n_dcbs;
size = ALIGN(size, PAGE_SIZE);
dma_free_coherent(lan966x->dev, size, fdma->dcbs, fdma->dma);
} }
static void lan966x_fdma_tx_activate(struct lan966x_tx *tx) static void lan966x_fdma_tx_activate(struct lan966x_tx *tx)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment