aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/slave.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-02-07 13:48:23 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-07 13:48:23 -0500
commit9d312cfb3d91227423f6e0f318de01f317130be5 (patch)
treecf8ebddef2228a4a1571c66faecf00d2eb238d7b /net/dsa/slave.c
parentMerge tag 'mlx5-updates-2017-01-31' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux (diff)
parentnet: dsa: Do not clobber PHY link outside of state machine (diff)
downloadlinux-dev-9d312cfb3d91227423f6e0f318de01f317130be5.tar.xz
linux-dev-9d312cfb3d91227423f6e0f318de01f317130be5.zip
Merge branch 'Incorrect-use-of-phy_read_status'
Florian Fainelli says: ==================== net: Incorrect use of phy_read_status() This patch series removes incorrect uses of phy_read_status() which can clobber the PHY device link while we are executing with the state machine running. greth was potentially another candidate, but it does funky stuff with auto-negotation that I am still trying to understand. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/slave.c')
-rw-r--r--net/dsa/slave.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 061a49c29cef..c34872e1febc 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -684,14 +684,10 @@ dsa_slave_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct dsa_slave_priv *p = netdev_priv(dev);
- int err;
+ int err = -EOPNOTSUPP;
- err = -EOPNOTSUPP;
- if (p->phy != NULL) {
- err = phy_read_status(p->phy);
- if (err == 0)
- err = phy_ethtool_ksettings_get(p->phy, cmd);
- }
+ if (p->phy != NULL)
+ err = phy_ethtool_ksettings_get(p->phy, cmd);
return err;
}