[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241006161032.14393-1-pvmohammedanees2003@gmail.com>
Date: Sun, 6 Oct 2024 21:40:32 +0530
From: Mohammed Anees <pvmohammedanees2003@...il.com>
To: andrew@...n.ch
Cc: davem@...emloft.net,
edumazet@...gle.com,
f.fainelli@...il.com,
kuba@...nel.org,
linux-kernel@...r.kernel.org,
linux@...linux.org.uk,
netdev@...r.kernel.org,
olteanv@...il.com,
pabeni@...hat.com,
pvmohammedanees2003@...il.com
Subject: Re: [PATCH] net: dsa: Fix conditional handling of Wake-on-Lan configuration in dsa_user_set_wol
Considering the insight you've provided, I've written the code below
static int dsa_user_set_wol(struct net_device *dev, struct ethtool_wolinfo *w)
{
struct dsa_port *dp = dsa_user_to_port(dev);
struct dsa_switch *ds = dp->ds;
int ret;
ret = phylink_ethtool_set_wol(dp->pl, w);
if (ret != -EOPNOTSUPP)
return ret;
if (ds->ops->set_wol)
ret = ds->ops->set_wol(ds, dp->index, w);
if (ret != -EOPNOTSUPP)
return ret;
return -EOPNOTSUPP;
}
Does this approach address the issue, or do you think it would
be better to pass a struct that explicitly contains only the
options supported by each function (phylink_ethtool_set_wol()
and ds->ops->set_wol())? That way we don't have to check for
-EOPNOTSUPP as we are giving valid options to each function.
Powered by blists - more mailing lists