diff options
author | Andrew Lunn <andrew@lunn.ch> | 2018-08-08 14:56:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-08-08 22:19:03 -0400 |
commit | 1be52e97ed3e524f82e25d6e53f48df3c6e85282 (patch) | |
tree | 30bdaf9599df7f1f7deec4ae369010bf7cd584b5 /net | |
parent | ef91b6f91ab8edfb3b90a03896004023dbac3e6e (diff) |
dsa: slave: eee: Allow ports to use phylink
For a port to be able to use EEE, both the MAC and the PHY must
support EEE. A phy can be provided by both a phydev or phylink. Verify
at least one of these exist, not just phydev.
Fixes: aab9c4067d23 ("net: dsa: Plug in PHYLINK support")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/dsa/slave.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 732369c80644..9864bcd3d317 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -639,7 +639,7 @@ static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e) | |||
639 | int ret; | 639 | int ret; |
640 | 640 | ||
641 | /* Port's PHY and MAC both need to be EEE capable */ | 641 | /* Port's PHY and MAC both need to be EEE capable */ |
642 | if (!dev->phydev) | 642 | if (!dev->phydev && !dp->pl) |
643 | return -ENODEV; | 643 | return -ENODEV; |
644 | 644 | ||
645 | if (!ds->ops->set_mac_eee) | 645 | if (!ds->ops->set_mac_eee) |
@@ -659,7 +659,7 @@ static int dsa_slave_get_eee(struct net_device *dev, struct ethtool_eee *e) | |||
659 | int ret; | 659 | int ret; |
660 | 660 | ||
661 | /* Port's PHY and MAC both need to be EEE capable */ | 661 | /* Port's PHY and MAC both need to be EEE capable */ |
662 | if (!dev->phydev) | 662 | if (!dev->phydev && !dp->pl) |
663 | return -ENODEV; | 663 | return -ENODEV; |
664 | 664 | ||
665 | if (!ds->ops->get_mac_eee) | 665 | if (!ds->ops->get_mac_eee) |