Skip to content

Commit 47f9605

Browse files
npitrePaolo Abeni
authored andcommitted
net: ethernet: ti: am65-cpsw: prevent WARN_ON upon module removal
In am65_cpsw_nuss_remove(), move the call to am65_cpsw_unregister_devlink() after am65_cpsw_nuss_cleanup_ndev() to avoid triggering the WARN_ON(devlink_port->type != DEVLINK_PORT_TYPE_NOTSET) in devl_port_unregister(). Makes it coherent with usage in m65_cpsw_nuss_register_ndevs()'s cleanup path. Fixes: 58356eb ("net: ti: am65-cpsw-nuss: Add devlink support") Signed-off-by: Nicolas Pitre <npitre@baylibre.com> Reviewed-by: Roger Quadros <rogerq@kernel.org> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent 3dc6e99 commit 47f9605

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/net/ethernet/ti/am65-cpsw-nuss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3652,13 +3652,13 @@ static void am65_cpsw_nuss_remove(struct platform_device *pdev)
36523652
return;
36533653
}
36543654

3655-
am65_cpsw_unregister_devlink(common);
36563655
am65_cpsw_unregister_notifiers(common);
36573656

36583657
/* must unregister ndevs here because DD release_driver routine calls
36593658
* dma_deconfigure(dev) before devres_release_all(dev)
36603659
*/
36613660
am65_cpsw_nuss_cleanup_ndev(common);
3661+
am65_cpsw_unregister_devlink(common);
36623662
am65_cpsw_nuss_phylink_cleanup(common);
36633663
am65_cpts_release(common->cpts);
36643664
am65_cpsw_disable_serdes_phy(common);

0 commit comments

Comments
 (0)