Re: [PATCH net v4 4/4] net: dsa: mxl-gsw1xx: manually clear RANEG bit

From: Daniel Golle
Date: Wed Dec 10 2025 - 11:03:48 EST


On Wed, Dec 10, 2025 at 05:52:49PM +0200, Vladimir Oltean wrote:
> On Tue, Dec 09, 2025 at 01:29:34AM +0000, Daniel Golle wrote:
> > [...]
> > @@ -665,6 +694,9 @@ static void gsw1xx_shutdown(struct mdio_device *mdiodev)
> > dsa_switch_shutdown(priv->ds);
> >
> > dev_set_drvdata(&mdiodev->dev, NULL);
> > +
> > + gsw1xx_priv = container_of(priv, struct gsw1xx_priv, gswip);
> > + cancel_delayed_work_sync(&gsw1xx_priv->clear_raneg);
>
> Nitpick: why did you place this after dev_set_drvdata(dev, NULL) and not before?
> The work item doesn't call dev_get_drvdata(), true, but it's one more refactoring
> step that needs to be taken care of if it should.

As the order of those two doesn't matter I thought the best would be
to do cancel_delayed_work_sync() as the last thing because it is
obviously correct. Eventhough even doing that at all doesn't matter
much in the shutdown() path anyway...