Skip to content

Commit

Permalink
net: phy: smsc: simplify lan95xx_config_aneg_ext
Browse files Browse the repository at this point in the history
lan95xx_config_aneg_ext() can be simplified by using phy_set_bits().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/3da785c7-3ef8-b5d3-89a0-340f550be3c2@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Heiner Kallweit authored and Jakub Kicinski committed Mar 8, 2023
1 parent 40bbae5 commit 4310e2f
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions drivers/net/phy/smsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,15 @@ static int lan87xx_config_aneg(struct phy_device *phydev)

static int lan95xx_config_aneg_ext(struct phy_device *phydev)
{
int rc;

if (phydev->phy_id != 0x0007c0f0) /* not (LAN9500A or LAN9505A) */
return lan87xx_config_aneg(phydev);
if (phydev->phy_id == 0x0007c0f0) { /* LAN9500A or LAN9505A */
/* Extend Manual AutoMDIX timer */
int rc = phy_set_bits(phydev, PHY_EDPD_CONFIG,
PHY_EDPD_CONFIG_EXT_CROSSOVER_);

/* Extend Manual AutoMDIX timer */
rc = phy_read(phydev, PHY_EDPD_CONFIG);
if (rc < 0)
return rc;
if (rc < 0)
return rc;
}

rc |= PHY_EDPD_CONFIG_EXT_CROSSOVER_;
phy_write(phydev, PHY_EDPD_CONFIG, rc);
return lan87xx_config_aneg(phydev);
}

Expand Down

0 comments on commit 4310e2f

Please sign in to comment.