Skip to content

Commit a007184

Browse files
BryanW11731-MCHPdavem330
authored andcommitted
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: 23f0703 ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Bryan Whitehead <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b7ea489 commit a007184

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/net/ethernet/microchip/lan743x_main.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -962,13 +962,10 @@ static void lan743x_phy_link_status_change(struct net_device *netdev)
962962

963963
memset(&ksettings, 0, sizeof(ksettings));
964964
phy_ethtool_get_link_ksettings(netdev, &ksettings);
965-
local_advertisement = phy_read(phydev, MII_ADVERTISE);
966-
if (local_advertisement < 0)
967-
return;
968-
969-
remote_advertisement = phy_read(phydev, MII_LPA);
970-
if (remote_advertisement < 0)
971-
return;
965+
local_advertisement =
966+
linkmode_adv_to_mii_adv_t(phydev->advertising);
967+
remote_advertisement =
968+
linkmode_adv_to_mii_adv_t(phydev->lp_advertising);
972969

973970
lan743x_phy_update_flowcontrol(adapter,
974971
ksettings.base.duplex,

0 commit comments

Comments
 (0)