[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241004220206.7576-1-pvmohammedanees2003@gmail.com>
Date: Sat, 5 Oct 2024 03:32:06 +0530
From: Mohammed Anees <pvmohammedanees2003@...il.com>
To: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Russell King <linux@...linux.org.uk>,
Mohammed Anees <pvmohammedanees2003@...il.com>
Subject: [PATCH] net: dsa: Fix conditional handling of Wake-on-Lan configuration in dsa_user_set_wol
The WOL configuration now checks if the DSA switch supports setting WOL
before attempting to apply settings via phylink. This prevents
unnecessary calls to phylink_ethtool_set_wol when WOL is not supported.
Signed-off-by: Mohammed Anees <pvmohammedanees2003@...il.com>
---
net/dsa/user.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/dsa/user.c b/net/dsa/user.c
index 74eda9b30608..c685ccea9ddf 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -1217,10 +1217,12 @@ static int dsa_user_set_wol(struct net_device *dev, struct ethtool_wolinfo *w)
struct dsa_switch *ds = dp->ds;
int ret = -EOPNOTSUPP;
- phylink_ethtool_set_wol(dp->pl, w);
-
- if (ds->ops->set_wol)
+ if (ds->ops->set_wol) {
ret = ds->ops->set_wol(ds, dp->index, w);
+ if (ret)
+ return ret;
+ phylink_ethtool_set_wol(dp->pl, w);
+ }
return ret;
}
--
2.46.0
Powered by blists - more mailing lists