Message ID | 20210208140341.9271-5-Sergey.Semin@baikalelectronics.ru |
---|---|
State | New |
Headers | show |
Series | net: stmmac: Obvious cleanups and several fixes | expand |
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index d45af1ea2565..1c40dc26fbf7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -5159,10 +5159,10 @@ int stmmac_dvr_remove(struct device *dev) stmmac_exit_fs(ndev); #endif phylink_destroy(priv->phylink); - reset_control_assert(priv->plat->stmmac_rst); if (priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); + reset_control_assert(priv->plat->stmmac_rst); destroy_workqueue(priv->wq); mutex_destroy(&priv->lock);
Indeed it's unlikely but MDIO de-registration may still require an access to the core registers, which obviously won't be possible in case if the interface has been put into the reset state. So move the reset control assertion to be executed after the MDIO bus is de-registered. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)