Skip to content

Commit

Permalink
dsa: slave: eee: Allow ports to use phylink
Browse files Browse the repository at this point in the history
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: aab9c40 ("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>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed Aug 9, 2018
1 parent ef91b6f commit 1be52e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ static int dsa_slave_set_eee(struct net_device *dev, struct ethtool_eee *e)
int ret;

/* Port's PHY and MAC both need to be EEE capable */
if (!dev->phydev)
if (!dev->phydev && !dp->pl)
return -ENODEV;

if (!ds->ops->set_mac_eee)
Expand All @@ -659,7 +659,7 @@ static int dsa_slave_get_eee(struct net_device *dev, struct ethtool_eee *e)
int ret;

/* Port's PHY and MAC both need to be EEE capable */
if (!dev->phydev)
if (!dev->phydev && !dp->pl)
return -ENODEV;

if (!ds->ops->get_mac_eee)
Expand Down

0 comments on commit 1be52e9

Please sign in to comment.