Message ID | 3da785c7-3ef8-b5d3-89a0-340f550be3c2@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 4310e2f42030ffda0997fb87e2ebdd9711030218 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: phy: smsc: simplify lan95xx_config_aneg_ext | expand |
On Mon, Mar 06, 2023 at 11:10:57PM +0100, Heiner Kallweit wrote: > 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>
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Mon, 6 Mar 2023 23:10:57 +0100 you wrote: > lan95xx_config_aneg_ext() can be simplified by using phy_set_bits(). > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > --- > drivers/net/phy/smsc.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) Here is the summary with links: - [net-next] net: phy: smsc: simplify lan95xx_config_aneg_ext https://git.kernel.org/netdev/net-next/c/4310e2f42030 You are awesome, thank you!
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c index be96c474c..0e9fcbe33 100644 --- a/drivers/net/phy/smsc.c +++ b/drivers/net/phy/smsc.c @@ -167,18 +167,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); }
lan95xx_config_aneg_ext() can be simplified by using phy_set_bits(). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/net/phy/smsc.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)