Skip to content

Commit 8d417fd

Browse files
oleremNipaLocal
authored andcommitted
net: usb: lan78xx: Use ethtool_op_get_link to reflect current link status
Replace the custom lan78xx_get_link implementation with the standard ethtool_op_get_link helper, which uses netif_carrier_ok to reflect the current link status accurately. Signed-off-by: Oleksij Rempel <[email protected]> Reviewed-by: Maxime Chevallier <[email protected]> Reviewed-by: Russell King (Oracle) <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent c9280f9 commit 8d417fd

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

drivers/net/usb/lan78xx.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,18 +1839,6 @@ static int lan78xx_set_eee(struct net_device *net, struct ethtool_keee *edata)
18391839
return ret;
18401840
}
18411841

1842-
static u32 lan78xx_get_link(struct net_device *net)
1843-
{
1844-
u32 link;
1845-
1846-
mutex_lock(&net->phydev->lock);
1847-
phy_read_status(net->phydev);
1848-
link = net->phydev->link;
1849-
mutex_unlock(&net->phydev->lock);
1850-
1851-
return link;
1852-
}
1853-
18541842
static void lan78xx_get_drvinfo(struct net_device *net,
18551843
struct ethtool_drvinfo *info)
18561844
{
@@ -1970,7 +1958,7 @@ lan78xx_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
19701958
}
19711959

19721960
static const struct ethtool_ops lan78xx_ethtool_ops = {
1973-
.get_link = lan78xx_get_link,
1961+
.get_link = ethtool_op_get_link,
19741962
.nway_reset = phy_ethtool_nway_reset,
19751963
.get_drvinfo = lan78xx_get_drvinfo,
19761964
.get_msglevel = lan78xx_get_msglevel,

0 commit comments

Comments
 (0)