From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: [PATCH net-next 6/9] net: dsa: Eliminate dsa_slave_get_link() Date: Sat, 5 May 2018 12:04:22 -0700 Message-ID: <20180505190425.14378-7-f.fainelli@gmail.com> References: <20180505190425.14378-1-f.fainelli@gmail.com> Cc: Florian Fainelli , privat@egil-hjelmeland.no, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, davem@davemloft.net, rmk+kernel@armlinux.org.uk, sean.wang@mediatek.com, Woojung.Huh@microchip.com, john@phrozen.org, cphealy@gmail.com To: netdev@vger.kernel.org Return-path: Received: from mail-ot0-f193.google.com ([74.125.82.193]:39562 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751969AbeEETEr (ORCPT ); Sat, 5 May 2018 15:04:47 -0400 Received: by mail-ot0-f193.google.com with SMTP id l12-v6so28023928oth.6 for ; Sat, 05 May 2018 12:04:47 -0700 (PDT) In-Reply-To: <20180505190425.14378-1-f.fainelli@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- net/dsa/slave.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index e9be9458aa94..e78894477598 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, -- 2.17.0