Commit b4cbd7a9 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jakub Kicinski

net: lan743x: Use correct variable in lan743x_sgmii_config()

There is a copy and paste bug in lan743x_sgmii_config() so it checks
if (ret < 0) instead of if (mii_ctl < 0).

Fixes: 46b777ad ("net: lan743x: Add support to SGMII 1G and 2.5G")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/YrRry7K66BzKezl8@kiliSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent cbdabaec
......@@ -1212,8 +1212,8 @@ static int lan743x_sgmii_config(struct lan743x_adapter *adapter)
/* SGMII/1000/2500BASE-X PCS power down */
mii_ctl = lan743x_sgmii_read(adapter, MDIO_MMD_VEND2, MII_BMCR);
if (ret < 0)
return ret;
if (mii_ctl < 0)
return mii_ctl;
mii_ctl |= BMCR_PDOWN;
ret = lan743x_sgmii_write(adapter, MDIO_MMD_VEND2, MII_BMCR, mii_ctl);
......
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