[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250904185926.GM372207@horms.kernel.org>
Date: Thu, 4 Sep 2025 19:59:26 +0100
From: Simon Horman <horms@...nel.org>
To: Stefan Wahren <wahrenst@....net>
Cc: Jakub Kicinski <kuba@...nel.org>, Wei Fang <wei.fang@....com>,
Shenwei Wang <shenwei.wang@....com>,
Clark Wang <xiaoning.wang@....com>,
Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
imx@...ts.linux.dev, netdev@...r.kernel.org,
Christoph Niedermaier <cniedermaier@...electronics.com>
Subject: Re: [PATCH net] net: fec: Fix possible NPD in
fec_enet_phy_reset_after_clk_enable()
On Thu, Sep 04, 2025 at 08:01:42PM +0200, Stefan Wahren wrote:
> Hi Jakub,
>
> [drop bouncing address]
>
> Am 04.09.25 um 15:58 schrieb Jakub Kicinski:
> > On Thu, 4 Sep 2025 11:13:34 +0200 Stefan Wahren wrote:
> > > phy_dev = of_phy_find_device(fep->phy_node);
> > > phy_reset_after_clk_enable(phy_dev);
> > > - put_device(&phy_dev->mdio.dev);
> > > + if (phy_dev)
> > > + put_device(&phy_dev->mdio.dev);
> > Looks correct, but isn't it better to also wrap
> > phy_reset_after_clk_enable() with the if()?
> since phy_reset_after_clk_enable() have an internal check, i thought it
> won't be necessary. So this variant has fewer lines.
FWIIW, I had the same thought as Jakub.
But I think it's a judgement call because, as Stefan says,
phy_reset_after_clk_enable() checks for NULL anyway.
Maybe one is easier to read than the other.
But I guess that is in the eye of the beholder.
And as we have this version I think it's just as well to stick with it.
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists