Commit 09d65e6d authored by Antoine Tenart's avatar Antoine Tenart Committed by David S. Miller

net: phy: mscc: add missing check on a phy_write return value

Commit a5afc167 ("net: phy: mscc: add support for VSC8584 PHY")
introduced a call to 'phy_write' storing its return value to a variable
called 'ret'. But 'ret' never was checked for a possible error being
returned, and hence was not used at all. Fix this by checking the return
value and exiting the function if an error was returned.

As this does not fix a known bug, this commit is mostly cosmetic and not
sent as a fix.
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0e1a5773
...@@ -1411,6 +1411,8 @@ static int vsc8584_config_init(struct phy_device *phydev) ...@@ -1411,6 +1411,8 @@ static int vsc8584_config_init(struct phy_device *phydev)
val |= (MEDIA_OP_MODE_COPPER << MEDIA_OP_MODE_POS) | val |= (MEDIA_OP_MODE_COPPER << MEDIA_OP_MODE_POS) |
(VSC8584_MAC_IF_SELECTION_SGMII << VSC8584_MAC_IF_SELECTION_POS); (VSC8584_MAC_IF_SELECTION_SGMII << VSC8584_MAC_IF_SELECTION_POS);
ret = phy_write(phydev, MSCC_PHY_EXT_PHY_CNTL_1, val); ret = phy_write(phydev, MSCC_PHY_EXT_PHY_CNTL_1, val);
if (ret)
return ret;
ret = genphy_soft_reset(phydev); ret = genphy_soft_reset(phydev);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment