Skip to content

Commit 8cdd0bd

Browse files
DanielmachonPaolo Abeni
authored andcommitted
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>
1 parent 29cc3a6 commit 8cdd0bd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,9 @@ static int lan966x_fdma_tx_alloc(struct lan966x_tx *tx)
229229
static void lan966x_fdma_tx_free(struct lan966x_tx *tx)
230230
{
231231
struct lan966x *lan966x = tx->lan966x;
232-
struct fdma *fdma = &tx->fdma;
233-
int size;
234232

235233
kfree(tx->dcbs_buf);
236-
237-
size = sizeof(struct fdma_dcb) * fdma->n_dcbs;
238-
size = ALIGN(size, PAGE_SIZE);
239-
dma_free_coherent(lan966x->dev, size, fdma->dcbs, fdma->dma);
234+
fdma_free_coherent(lan966x->dev, &tx->fdma);
240235
}
241236

242237
static void lan966x_fdma_tx_activate(struct lan966x_tx *tx)

0 commit comments

Comments
 (0)