From: Jon Hunter <jonathanh@nvidia.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
Peter De Schrijver <pdeschrijver@nvidia.com>,
Prashant Gaikwad <pgaikwad@nvidia.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: tegra: tegra124-emc: Simplify with scoped for each OF child loop
Date: Fri, 2 Jan 2026 16:08:43 +0000 [thread overview]
Message-ID: <bf03ca52-41fb-405f-8455-5fb128289f5f@nvidia.com> (raw)
In-Reply-To: <20260102125019.65129-2-krzysztof.kozlowski@oss.qualcomm.com>
On 02/01/2026 12:50, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
> drivers/clk/tegra/clk-tegra124-emc.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c
> index 2a6db0434281..2953b62cb619 100644
> --- a/drivers/clk/tegra/clk-tegra124-emc.c
> +++ b/drivers/clk/tegra/clk-tegra124-emc.c
> @@ -444,7 +444,6 @@ static int load_timings_from_dt(struct tegra_clk_emc *tegra,
> u32 ram_code)
> {
> struct emc_timing *timings_ptr;
> - struct device_node *child;
> int child_count = of_get_child_count(node);
> int i = 0, err;
> size_t size;
> @@ -458,12 +457,11 @@ static int load_timings_from_dt(struct tegra_clk_emc *tegra,
> timings_ptr = tegra->timings + tegra->num_timings;
> tegra->num_timings += child_count;
>
> - for_each_child_of_node(node, child) {
> + for_each_child_of_node_scoped(node, child) {
> struct emc_timing *timing = timings_ptr + (i++);
>
> err = load_one_timing_from_dt(tegra, timing, child);
> if (err) {
> - of_node_put(child);
> kfree(tegra->timings);
> return err;
> }
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Thanks!
Jon
--
nvpublic
next prev parent reply other threads:[~2026-01-02 16:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-02 12:50 Krzysztof Kozlowski
2026-01-02 16:08 ` Jon Hunter [this message]
2026-01-17 0:11 ` Thierry Reding
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=bf03ca52-41fb-405f-8455-5fb128289f5f@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=pdeschrijver@nvidia.com \
--cc=pgaikwad@nvidia.com \
--cc=sboyd@kernel.org \
--cc=thierry.reding@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®