Skip to content

Commit ccd21ec

Browse files
Tom Rixdavem330
authored andcommitted
ethtool: use phydev variable
In ethtool_get_phy_stats(), the phydev varaible is set to dev->phydev but dev->phydev is still used. Replace dev->phydev uses with phydev. Signed-off-by: Tom Rix <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8876769 commit ccd21ec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/ethtool/ioctl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,9 +2096,9 @@ static int ethtool_get_phy_stats(struct net_device *dev, void __user *useraddr)
20962096
if (!phydev && (!ops->get_ethtool_phy_stats || !ops->get_sset_count))
20972097
return -EOPNOTSUPP;
20982098

2099-
if (dev->phydev && !ops->get_ethtool_phy_stats &&
2099+
if (phydev && !ops->get_ethtool_phy_stats &&
21002100
phy_ops && phy_ops->get_sset_count)
2101-
n_stats = phy_ops->get_sset_count(dev->phydev);
2101+
n_stats = phy_ops->get_sset_count(phydev);
21022102
else
21032103
n_stats = ops->get_sset_count(dev, ETH_SS_PHY_STATS);
21042104
if (n_stats < 0)
@@ -2117,9 +2117,9 @@ static int ethtool_get_phy_stats(struct net_device *dev, void __user *useraddr)
21172117
if (!data)
21182118
return -ENOMEM;
21192119

2120-
if (dev->phydev && !ops->get_ethtool_phy_stats &&
2120+
if (phydev && !ops->get_ethtool_phy_stats &&
21212121
phy_ops && phy_ops->get_stats) {
2122-
ret = phy_ops->get_stats(dev->phydev, &stats, data);
2122+
ret = phy_ops->get_stats(phydev, &stats, data);
21232123
if (ret < 0)
21242124
goto out;
21252125
} else {

0 commit comments

Comments
 (0)