Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net:fec: Add fec_enet_deinit()

When fec_probe() fails or fec_drv_remove() needs to release the
fec queue and remove a NAPI context, therefore add a function
corresponding to fec_enet_init() and call fec_enet_deinit() which
does the opposite to release memory and remove a NAPI context.

Fixes: 59d0f7465644 ("net: fec: init multi queue date structure")
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20240524050528.4115581-1-xiaolei.wang@windriver.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Xiaolei Wang and committed by
Jakub Kicinski
bf0497f5 12f86b9a

+10
+10
drivers/net/ethernet/freescale/fec_main.c
··· 4130 4130 return ret; 4131 4131 } 4132 4132 4133 + static void fec_enet_deinit(struct net_device *ndev) 4134 + { 4135 + struct fec_enet_private *fep = netdev_priv(ndev); 4136 + 4137 + netif_napi_del(&fep->napi); 4138 + fec_enet_free_queue(ndev); 4139 + } 4140 + 4133 4141 #ifdef CONFIG_OF 4134 4142 static int fec_reset_phy(struct platform_device *pdev) 4135 4143 { ··· 4532 4524 fec_enet_mii_remove(fep); 4533 4525 failed_mii_init: 4534 4526 failed_irq: 4527 + fec_enet_deinit(ndev); 4535 4528 failed_init: 4536 4529 fec_ptp_stop(pdev); 4537 4530 failed_reset: ··· 4596 4587 pm_runtime_put_noidle(&pdev->dev); 4597 4588 pm_runtime_disable(&pdev->dev); 4598 4589 4590 + fec_enet_deinit(ndev); 4599 4591 free_netdev(ndev); 4600 4592 } 4601 4593