diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2018-05-10 13:17:34 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-11 12:03:06 -0400 |
commit | c4aef9fc0d4b1d497c2f2973e3f123bcb96d6bbc (patch) | |
tree | 3f5664aa969c65185742a89fa10c41d0738e76b8 | |
parent | bc0cb653a3f06b5a1ee9f12cc1c367a8736aca28 (diff) |
net: dsa: Eliminate dsa_slave_get_link()
Since we use PHYLIB to manage the per-port link indication, this will
also be reflected correctly in the network device's carrier state, so we
can use ethtool_op_get_link() instead.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/dsa/slave.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 6c2f042e3c29..729f18d23bdd 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -498,16 +498,6 @@ dsa_slave_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *_p) ds->ops->get_regs(ds, dp->index, regs, _p); } -static u32 dsa_slave_get_link(struct net_device *dev) -{ - if (!dev->phydev) - return -ENODEV; - - genphy_update_link(dev->phydev); - - return dev->phydev->link; -} - static int dsa_slave_get_eeprom_len(struct net_device *dev) { struct dsa_port *dp = dsa_slave_to_port(dev); @@ -982,7 +972,7 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = { .get_regs_len = dsa_slave_get_regs_len, .get_regs = dsa_slave_get_regs, .nway_reset = phy_ethtool_nway_reset, - .get_link = dsa_slave_get_link, + .get_link = ethtool_op_get_link, .get_eeprom_len = dsa_slave_get_eeprom_len, .get_eeprom = dsa_slave_get_eeprom, .set_eeprom = dsa_slave_set_eeprom, |