netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	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
Subject: [PATCH net-next 1/4] net: dsa: Eliminate dsa_slave_get_link()
Date: Sun, 18 Mar 2018 11:52:43 -0700	[thread overview]
Message-ID: <20180318185246.19311-2-f.fainelli@gmail.com> (raw)
In-Reply-To: <20180318185246.19311-1-f.fainelli@gmail.com>

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>
---
 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 18561af7a8f1..9714e8b002d3 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);
@@ -981,7 +971,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.14.1

  reply	other threads:[~2018-03-18 18:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-18 18:52 [PATCH net-next 0/4] net: dsa: Plug in PHYLINK support Florian Fainelli
2018-03-18 18:52 ` Florian Fainelli [this message]
2018-03-18 19:12   ` [PATCH net-next 1/4] net: dsa: Eliminate dsa_slave_get_link() Andrew Lunn
2018-03-18 18:52 ` [PATCH net-next 2/4] net: phy: phylink: Provide PHY interface to mac_link_{up,down} Florian Fainelli
2018-03-28  9:50   ` Russell King - ARM Linux
2018-03-18 18:52 ` [PATCH net-next 3/4] net: dsa: Plug in PHYLINK support Florian Fainelli
2018-03-18 19:19   ` Andrew Lunn
2018-03-19 17:59     ` Florian Fainelli
2018-03-19 18:09       ` Russell King - ARM Linux
2018-03-19 18:11         ` Florian Fainelli
2018-03-18 18:52 ` [PATCH net-next 4/4] net: dsa: bcm_sf2: Implement phylink_mac_ops Florian Fainelli
2018-03-19  0:11 ` [PATCH net-next 0/4] net: dsa: Plug in PHYLINK support Florian Fainelli
2018-03-19 13:44   ` Andrew Lunn
2018-03-19 17:45     ` Florian Fainelli
2018-03-20 15:28 ` David Miller
2018-03-20 15:51   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180318185246.19311-2-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=john@phrozen.org \
    --cc=netdev@vger.kernel.org \
    --cc=privat@egil-hjelmeland.no \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=sean.wang@mediatek.com \
    --cc=vivien.didelot@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).