From: Simon Horman <horms@kernel.org>
To: Stefan Wahren <wahrenst@gmx.net>
Cc: Jakub Kicinski <kuba@kernel.org>, Wei Fang <wei.fang@nxp.com>,
Shenwei Wang <shenwei.wang@nxp.com>,
Clark Wang <xiaoning.wang@nxp.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
imx@lists.linux.dev, netdev@vger.kernel.org,
Christoph Niedermaier <cniedermaier@dh-electronics.com>
Subject: Re: [PATCH net] net: fec: Fix possible NPD in fec_enet_phy_reset_after_clk_enable()
Date: Thu, 4 Sep 2025 19:59:26 +0100 [thread overview]
Message-ID: <20250904185926.GM372207@horms.kernel.org> (raw)
In-Reply-To: <0ae16ef0-45d7-4775-a825-87a352fc03e0@gmx.net>
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@kernel.org>
next prev parent reply other threads:[~2025-09-04 18:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-04 9:13 [PATCH net] net: fec: Fix possible NPD in fec_enet_phy_reset_after_clk_enable() Stefan Wahren
2025-09-04 13:58 ` Jakub Kicinski
2025-09-04 18:01 ` Stefan Wahren
2025-09-04 18:59 ` Simon Horman [this message]
2025-09-05 2:11 ` Wei Fang
2025-09-06 1:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250904185926.GM372207@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=cniedermaier@dh-electronics.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=imx@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shenwei.wang@nxp.com \
--cc=wahrenst@gmx.net \
--cc=wei.fang@nxp.com \
--cc=xiaoning.wang@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.