Skip to contentSkip to conversation

lan743x: Remove phy_read from link status change function

PATCH Applied Bryan Whitehead 3 participants 3 messages Jan 7, 2019 – Jan 8, 2019

Subsystems (3)
lore
Share & tools
lore

Bryan Whitehead

author maintainer
#0 lore raw

PATCH 1/1 lan743x: Remove phy_read from link status change function

It has been noticed that some phys do not have the registers required by the previous implementation.

To fix this, instead of using phy_read, the required information is extracted from the phy_device structure.

Fixes 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
---
 drivers/net/ethernet/microchip/lan743x_main.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/net/ethernet/microchip/lan743x_main.c +4 -7
index 20c9377..310807e 100644
@@ -962,13 +962,10 @@ static void lan743x_phy_link_status_change(struct net_device *netdev)
 
 		memset(&ksettings, 0, sizeof(ksettings));
 		phy_ethtool_get_link_ksettings(netdev, &ksettings);
-		local_advertisement = phy_read(phydev, MII_ADVERTISE);
-		if (local_advertisement < 0)
-			return;
-
-		remote_advertisement = phy_read(phydev, MII_LPA);
-		if (remote_advertisement < 0)
-			return;
+		local_advertisement =
+			linkmode_adv_to_mii_adv_t(phydev->advertising);
+		remote_advertisement =
+			linkmode_adv_to_mii_adv_t(phydev->lp_advertising);
 
 		lan743x_phy_update_flowcontrol(adapter,
 					       ksettings.base.duplex,
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Bryan Whitehead

It has been noticed that some phys do not have the registers required by the previous implementation.

To fix this, instead of using phy_read, the required information is extracted from the phy_device structure.

Fixes 23f0703c125b ("lan743x: Add main source files for new lan743x driver")

Andrew

maintainer Applied
#2 lore raw
In reply to Bryan Whitehead

From: Bryan Whitehead <[email protected]>
Date: Mon, 7 Jan 2019 14:00:09 -0500

Quoted 8 lines

It has been noticed that some phys do not have the registers required by the previous implementation.

To fix this, instead of using phy_read, the required information is extracted from the phy_device structure.

Fixes 23f0703c125b ("lan743x: Add main source files for new lan743x driver")

Applied, thanks.