From: Zijun Hu <zijun_hu@icloud.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Vinod Koul <vkoul@kernel.org>,
Kishon Vijay Abraham I <kishon@kernel.org>,
Felipe Balbi <balbi@ti.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Rob Herring <robh@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Lee Jones <lee@kernel.org>
Cc: stable@vger.kernel.org, linux-phy@lists.infradead.org,
netdev@vger.kernel.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, Zijun Hu <quic_zijuhu@quicinc.com>
Subject: Re: [PATCH 5/6] phy: core: Add missing of_node_put() in of_phy_provider_lookup()
Date: Sun, 20 Oct 2024 16:18:03 +0800 [thread overview]
Message-ID: <e165fb81-8d96-49dc-9bfd-85ae79ef4f64@icloud.com> (raw)
In-Reply-To: <5e828a43-9365-4ac5-b411-0be7188ab8f2@wanadoo.fr>
On 2024/10/20 15:23, Christophe JAILLET wrote:
> Le 20/10/2024 à 07:27, Zijun Hu a écrit :
>> From: Zijun Hu <quic_zijuhu@quicinc.com>
[snip]
>> ---
>> drivers/phy/phy-core.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
>> index 967878b78797..24bd619a33dd 100644
>> --- a/drivers/phy/phy-core.c
>> +++ b/drivers/phy/phy-core.c
>> @@ -143,10 +143,11 @@ static struct phy_provider
>> *of_phy_provider_lookup(struct device_node *node)
>> list_for_each_entry(phy_provider, &phy_provider_list, list) {
>> if (phy_provider->dev->of_node == node)
>> return phy_provider;
>> -
>> for_each_child_of_node(phy_provider->children, child)
>> - if (child == node)
>> + if (child == node) {
>> + of_node_put(child);
>> return phy_provider;
>> + }
>
> Hi,
>
> Maybe for_each_child_of_node_scoped() to slightly simplify things at the
> same time?
>
thank you for code review.
it does not use _scoped() since for_each_child_of_node() usage here is
very simple and only has one early exit, _scoped() normally is for
complex case.
i maybe use _scoped() in next revision if one more reviewer also prefers
it.
thank you.
>> }
>> return ERR_PTR(-EPROBE_DEFER);
>>
>
next prev parent reply other threads:[~2024-10-20 8:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-20 5:27 [PATCH 0/6] phy: core: Fix bugs for several APIs and simplify an API Zijun Hu
2024-10-20 5:27 ` [PATCH 1/6] phy: core: Fix API devm_phy_put() can not release the phy Zijun Hu
2024-10-20 5:27 ` [PATCH 2/6] phy: core: Fix API devm_of_phy_provider_unregister() can not unregister the phy provider Zijun Hu
2024-10-20 5:27 ` [PATCH 3/6] phy: core: Fix API devm_phy_destroy() can not destroy the phy Zijun Hu
2024-10-20 5:27 ` [PATCH 4/6] phy: core: Add missing of_node_put() for an error handling path of _of_phy_get() Zijun Hu
2024-10-20 5:27 ` [PATCH 5/6] phy: core: Add missing of_node_put() in of_phy_provider_lookup() Zijun Hu
2024-10-20 7:23 ` Christophe JAILLET
2024-10-20 8:18 ` Zijun Hu [this message]
2024-10-20 5:27 ` [PATCH 6/6] phy: core: Simplify API of_phy_simple_xlate() implementation Zijun Hu
2024-10-20 10:19 ` Zijun Hu
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=e165fb81-8d96-49dc-9bfd-85ae79ef4f64@icloud.com \
--to=zijun_hu@icloud.com \
--cc=arnd@arndb.de \
--cc=balbi@ti.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=kishon@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=quic_zijuhu@quicinc.com \
--cc=robh@kernel.org \
--cc=stable@vger.kernel.org \
--cc=vkoul@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox