From 66c366392e55ae07e37699eeacca50f01b0bb879 Mon Sep 17 00:00:00 2001 From: "Russell King (Oracle)" Date: Tue, 10 Dec 2024 14:18:11 +0000 Subject: [PATCH] net: dsa: remove check for dp->pl in EEE methods When user ports are initialised, a phylink instance is always created, and so dp->pl will always be non-NULL. The EEE methods are only used for user ports, so checking for dp->pl to be NULL makes no sense. No other phylink-calling method implements similar checks in DSA. Remove this unnecessary check. Signed-off-by: Russell King (Oracle) Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Link: https://patch.msgid.link/E1tL13z-006cZ7-BZ@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski --- net/dsa/user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/dsa/user.c b/net/dsa/user.c index c736c019e2af..e1a0b153c353 100644 --- a/net/dsa/user.c +++ b/net/dsa/user.c @@ -1230,7 +1230,7 @@ static int dsa_user_set_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Port's PHY and MAC both need to be EEE capable */ - if (!dev->phydev || !dp->pl) + if (!dev->phydev) return -ENODEV; if (!ds->ops->set_mac_eee) @@ -1250,7 +1250,7 @@ static int dsa_user_get_eee(struct net_device *dev, struct ethtool_keee *e) int ret; /* Port's PHY and MAC both need to be EEE capable */ - if (!dev->phydev || !dp->pl) + if (!dev->phydev) return -ENODEV; if (!ds->ops->get_mac_eee)