Skip to content

Commit 4310e2f

Browse files
hkallweitkuba-moo
authored andcommitted
net: phy: smsc: simplify lan95xx_config_aneg_ext
lan95xx_config_aneg_ext() can be simplified by using phy_set_bits(). Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 40bbae5 commit 4310e2f

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

drivers/net/phy/smsc.c

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,15 @@ static int lan87xx_config_aneg(struct phy_device *phydev)
178178

179179
static int lan95xx_config_aneg_ext(struct phy_device *phydev)
180180
{
181-
int rc;
182-
183-
if (phydev->phy_id != 0x0007c0f0) /* not (LAN9500A or LAN9505A) */
184-
return lan87xx_config_aneg(phydev);
181+
if (phydev->phy_id == 0x0007c0f0) { /* LAN9500A or LAN9505A */
182+
/* Extend Manual AutoMDIX timer */
183+
int rc = phy_set_bits(phydev, PHY_EDPD_CONFIG,
184+
PHY_EDPD_CONFIG_EXT_CROSSOVER_);
185185

186-
/* Extend Manual AutoMDIX timer */
187-
rc = phy_read(phydev, PHY_EDPD_CONFIG);
188-
if (rc < 0)
189-
return rc;
186+
if (rc < 0)
187+
return rc;
188+
}
190189

191-
rc |= PHY_EDPD_CONFIG_EXT_CROSSOVER_;
192-
phy_write(phydev, PHY_EDPD_CONFIG, rc);
193190
return lan87xx_config_aneg(phydev);
194191
}
195192

0 commit comments

Comments
 (0)