Re: [PATCH net-next 6/6] net: ethernet: fs_enet: phylink conversion

From: Maxime Chevallier
Date: Wed Aug 28 2024 - 07:45:04 EST


Hi Russell,

On Wed, 28 Aug 2024 11:38:31 +0100
"Russell King (Oracle)" <linux@xxxxxxxxxxxxxxx> wrote:

> On Wed, Aug 28, 2024 at 11:51:02AM +0200, Maxime Chevallier wrote:
> > +static int fs_eth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
> > +{
> > + struct fs_enet_private *fep = netdev_priv(dev);
> > +
> > + if (!netif_running(dev))
> > + return -EINVAL;
>
> Why do you need this check?
>

I included it as the original ioctl was phy_do_ioctl_running(), which
includes that check.

Is this check irrelevant with phylink ? I could only find macb and
xilinx_axienet that do the same check in their ioctl.

I can't tell you why that check is there in the first place in that
driver, a quick grep search leads back from a major driver rework in
2011, at which point the check was already there...

Regards,

Maxime