From: Gatien CHEVALLIER <gatien.chevallier@foss.st.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
"Bjorn Andersson" <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>
Cc: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: Re: [PATCH v2 2/3] bus: stm32_firewall: Simplify with scoped for each OF child loop
Date: Fri, 9 Jan 2026 11:33:57 +0100 [thread overview]
Message-ID: <2405bd00-e10b-4369-9819-c6782c4f9708@foss.st.com> (raw)
In-Reply-To: <20260105143657.383621-5-krzysztof.kozlowski@oss.qualcomm.com>
Hello,
Tested on stm32mp135f-dk, so:
Tested-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Thank you
On 1/5/26 15:36, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>
> ---
>
> Changes in v2:
> 1. Add Rb tag
> ---
> drivers/bus/stm32_firewall.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/bus/stm32_firewall.c b/drivers/bus/stm32_firewall.c
> index 2fc9761dadec..fae881cea9a0 100644
> --- a/drivers/bus/stm32_firewall.c
> +++ b/drivers/bus/stm32_firewall.c
> @@ -241,7 +241,6 @@ EXPORT_SYMBOL_GPL(stm32_firewall_controller_unregister);
> int stm32_firewall_populate_bus(struct stm32_firewall_controller *firewall_controller)
> {
> struct stm32_firewall *firewalls;
> - struct device_node *child;
> struct device *parent;
> unsigned int i;
> int len;
> @@ -251,25 +250,20 @@ int stm32_firewall_populate_bus(struct stm32_firewall_controller *firewall_contr
>
> dev_dbg(parent, "Populating %s system bus\n", dev_name(firewall_controller->dev));
>
> - for_each_available_child_of_node(dev_of_node(parent), child) {
> + for_each_available_child_of_node_scoped(dev_of_node(parent), child) {
> /* The access-controllers property is mandatory for firewall bus devices */
> len = of_count_phandle_with_args(child, "access-controllers",
> "#access-controller-cells");
> - if (len <= 0) {
> - of_node_put(child);
> + if (len <= 0)
> return -EINVAL;
> - }
>
> firewalls = kcalloc(len, sizeof(*firewalls), GFP_KERNEL);
> - if (!firewalls) {
> - of_node_put(child);
> + if (!firewalls)
> return -ENOMEM;
> - }
>
> err = stm32_firewall_get_firewall(child, firewalls, (unsigned int)len);
> if (err) {
> kfree(firewalls);
> - of_node_put(child);
> return err;
> }
>
next prev parent reply other threads:[~2026-01-09 10:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-05 14:36 [PATCH v2 1/3] bus: qcom-ebi2: " Krzysztof Kozlowski
2026-01-05 14:36 ` [PATCH v2 2/3] bus: stm32_firewall: " Krzysztof Kozlowski
2026-01-09 10:33 ` Gatien CHEVALLIER [this message]
2026-01-05 14:37 ` [PATCH v2 3/3] bus: stm32_firewall: Use scoped allocation to simplify cleanup Krzysztof Kozlowski
2026-01-09 10:37 ` Gatien CHEVALLIER
2026-01-09 11:55 ` Krzysztof Kozlowski
2026-01-09 12:34 ` Gatien CHEVALLIER
2026-01-09 15:20 ` Krzysztof Kozlowski
2026-03-01 14:12 ` Krzysztof Kozlowski
2026-03-02 8:15 ` Alexandre TORGUE
2026-03-10 9:04 ` Alexandre TORGUE
2026-01-05 14:38 ` [PATCH v2 1/3] bus: qcom-ebi2: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-01-06 17:52 ` (subset) " Bjorn Andersson
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=2405bd00-e10b-4369-9819-c6782c4f9708@foss.st.com \
--to=gatien.chevallier@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andersson@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®