From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: [PATCH] dsa: slave: eee: Allow ports to use phylink Date: Wed, 8 Aug 2018 20:56:40 +0200 Message-ID: <1533754600-1753-1-git-send-email-andrew@lunn.ch> Cc: netdev , Florian Fainelli , Andrew Lunn To: David Miller Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:59014 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728134AbeHHVSA (ORCPT ); Wed, 8 Aug 2018 17:18:00 -0400 Sender: netdev-owner@vger.kernel.org List-ID: 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 --- net/dsa/slave.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 80b71bab3e59..973e99aa4107 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -640,7 +640,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) @@ -660,7 +660,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) -- 2.18.0