net: stmmac: add missing serdes power down in error paths

The open path is missing cleanup of a successful serdes power up if
stmmac_hw_setup() or stmmac_request_irq() fails.

stmmac_resume() is also missing cleanup of the serdes power up if
stmmac_hw_setup() fails.

Add the missing cleanups.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vnDDo-00000007Xx9-3RZ8@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Russell King (Oracle) 2026-02-03 10:01:24 +00:00 committed by Jakub Kicinski
parent 9bfcf5460b
commit 3019a1333e

View File

@ -4137,7 +4137,7 @@ static int __stmmac_open(struct net_device *dev,
if (!(priv->plat->flags & STMMAC_FLAG_SERDES_UP_AFTER_PHY_LINKUP)) {
ret = stmmac_legacy_serdes_power_up(priv);
if (ret < 0)
goto init_error;
return ret;
}
ret = stmmac_hw_setup(dev);
@ -4170,6 +4170,7 @@ static int __stmmac_open(struct net_device *dev,
stmmac_release_ptp(priv);
init_error:
stmmac_legacy_serdes_power_down(priv);
return ret;
}
@ -8273,6 +8274,7 @@ int stmmac_resume(struct device *dev)
ret = stmmac_hw_setup(ndev);
if (ret < 0) {
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
stmmac_legacy_serdes_power_down(priv);
mutex_unlock(&priv->lock);
rtnl_unlock();
return ret;