From: Pratyush Yadav <pratyush@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Cc: Brian Norris <computersforpeace@gmail.com>,
Kamal Dasu <kamal.dasu@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Harvey Hunt <harveyhuntnexus@gmail.com>,
Paul Cercueil <paul@crapouillou.net>,
Manivannan Sadhasivam <mani@kernel.org>,
Stefan Agner <stefan@agner.ch>,
Tudor Ambarus <tudor.ambarus@linaro.org>,
Pratyush Yadav <pratyush@kernel.org>,
Michael Walle <mwalle@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-mips@vger.kernel.org, linux-arm-msm@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH 7/7] mtd: spi-nor: hisi-sfc: Simplify with scoped for each OF child loop
Date: Fri, 02 Jan 2026 14:33:59 +0100 [thread overview]
Message-ID: <86a4yw87g8.fsf@kernel.org> (raw)
In-Reply-To: <20260102124927.64703-14-krzysztof.kozlowski@oss.qualcomm.com> (Krzysztof Kozlowski's message of "Fri, 2 Jan 2026 13:49:34 +0100")
Hi Kyzystof,
Thanks for the cleanup.
On Fri, Jan 02 2026, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
Nit: the commit message is a bit too dry. I had to go and look what the
difference between the two variants was. I could make an educated guess
by looking at the patch, but still.
If you end up doing a v2, a one-liner explanation of the difference
between the two loop variants would be nice to have.
Acked-by: Pratyush Yadav <pratyush@kernel.org>
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
> drivers/mtd/spi-nor/controllers/hisi-sfc.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/controllers/hisi-sfc.c b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
> index db948da2c4c5..54c49a8423a2 100644
> --- a/drivers/mtd/spi-nor/controllers/hisi-sfc.c
> +++ b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
> @@ -394,15 +394,12 @@ static void hisi_spi_nor_unregister_all(struct hifmc_host *host)
> static int hisi_spi_nor_register_all(struct hifmc_host *host)
> {
> struct device *dev = host->dev;
> - struct device_node *np;
> int ret;
>
> - for_each_available_child_of_node(dev->of_node, np) {
> + for_each_available_child_of_node_scoped(dev->of_node, np) {
> ret = hisi_spi_nor_register(np, host);
> - if (ret) {
> - of_node_put(np);
> + if (ret)
> goto fail;
> - }
>
> if (host->num_chip == HIFMC_MAX_CHIP_NUM) {
> dev_warn(dev, "Flash device number exceeds the maximum chipselect number\n");
--
Regards,
Pratyush Yadav
WARNING: multiple messages have this Message-ID (diff)
From: Pratyush Yadav <pratyush@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Cc: Brian Norris <computersforpeace@gmail.com>,
Kamal Dasu <kamal.dasu@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Harvey Hunt <harveyhuntnexus@gmail.com>,
Paul Cercueil <paul@crapouillou.net>,
Manivannan Sadhasivam <mani@kernel.org>,
Stefan Agner <stefan@agner.ch>,
Tudor Ambarus <tudor.ambarus@linaro.org>,
Pratyush Yadav <pratyush@kernel.org>,
Michael Walle <mwalle@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-mips@vger.kernel.org, linux-arm-msm@vger.kernel.org,
llvm@lists.linux.dev
Subject: Re: [PATCH 7/7] mtd: spi-nor: hisi-sfc: Simplify with scoped for each OF child loop
Date: Fri, 02 Jan 2026 14:33:59 +0100 [thread overview]
Message-ID: <86a4yw87g8.fsf@kernel.org> (raw)
In-Reply-To: <20260102124927.64703-14-krzysztof.kozlowski@oss.qualcomm.com> (Krzysztof Kozlowski's message of "Fri, 2 Jan 2026 13:49:34 +0100")
Hi Kyzystof,
Thanks for the cleanup.
On Fri, Jan 02 2026, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
Nit: the commit message is a bit too dry. I had to go and look what the
difference between the two variants was. I could make an educated guess
by looking at the patch, but still.
If you end up doing a v2, a one-liner explanation of the difference
between the two loop variants would be nice to have.
Acked-by: Pratyush Yadav <pratyush@kernel.org>
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
> drivers/mtd/spi-nor/controllers/hisi-sfc.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/controllers/hisi-sfc.c b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
> index db948da2c4c5..54c49a8423a2 100644
> --- a/drivers/mtd/spi-nor/controllers/hisi-sfc.c
> +++ b/drivers/mtd/spi-nor/controllers/hisi-sfc.c
> @@ -394,15 +394,12 @@ static void hisi_spi_nor_unregister_all(struct hifmc_host *host)
> static int hisi_spi_nor_register_all(struct hifmc_host *host)
> {
> struct device *dev = host->dev;
> - struct device_node *np;
> int ret;
>
> - for_each_available_child_of_node(dev->of_node, np) {
> + for_each_available_child_of_node_scoped(dev->of_node, np) {
> ret = hisi_spi_nor_register(np, host);
> - if (ret) {
> - of_node_put(np);
> + if (ret)
> goto fail;
> - }
>
> if (host->num_chip == HIFMC_MAX_CHIP_NUM) {
> dev_warn(dev, "Flash device number exceeds the maximum chipselect number\n");
--
Regards,
Pratyush Yadav
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2026-01-02 13:34 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-02 12:49 [PATCH 1/7] mtd: rawnand: brcm: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-01-02 12:49 ` Krzysztof Kozlowski
2026-01-02 12:49 ` [PATCH 2/7] mtd: rawnand: denali: " Krzysztof Kozlowski
2026-01-02 12:49 ` Krzysztof Kozlowski
2026-01-02 12:49 ` [PATCH 3/7] mtd: rawnand: ingenic: " Krzysztof Kozlowski
2026-01-02 12:49 ` Krzysztof Kozlowski
2026-01-02 22:22 ` Paul Cercueil
2026-01-02 22:22 ` Paul Cercueil
2026-01-02 12:49 ` [PATCH 4/7] mtd: rawnand: qcom: " Krzysztof Kozlowski
2026-01-02 12:49 ` Krzysztof Kozlowski
2026-01-02 13:59 ` Konrad Dybcio
2026-01-02 13:59 ` Konrad Dybcio
2026-01-05 7:45 ` Manivannan Sadhasivam
2026-01-05 7:45 ` Manivannan Sadhasivam
2026-01-02 12:49 ` [PATCH 5/7] mtd: rawnand: vf610: Fix Wvoid-pointer-to-enum-cast warning Krzysztof Kozlowski
2026-01-02 12:49 ` Krzysztof Kozlowski
2026-01-02 12:49 ` [PATCH 6/7] mtd: rawnand: vf610: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-01-02 12:49 ` Krzysztof Kozlowski
2026-01-02 12:49 ` [PATCH 7/7] mtd: spi-nor: hisi-sfc: " Krzysztof Kozlowski
2026-01-02 12:49 ` Krzysztof Kozlowski
2026-01-02 13:33 ` Pratyush Yadav [this message]
2026-01-02 13:33 ` Pratyush Yadav
2026-01-03 12:38 ` Krzysztof Kozlowski
2026-01-03 12:38 ` Krzysztof Kozlowski
2026-01-03 23:28 ` Pratyush Yadav
2026-01-03 23:28 ` Pratyush Yadav
2026-01-03 23:57 ` Vladimir Zapolskiy
2026-01-03 23:57 ` Vladimir Zapolskiy
2026-01-19 10:14 ` [PATCH 1/7] mtd: rawnand: brcm: " Miquel Raynal
2026-01-19 10:14 ` Miquel Raynal
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=86a4yw87g8.fsf@kernel.org \
--to=pratyush@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=computersforpeace@gmail.com \
--cc=harveyhuntnexus@gmail.com \
--cc=justinstitt@google.com \
--cc=kamal.dasu@broadcom.com \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=llvm@lists.linux.dev \
--cc=mani@kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=morbo@google.com \
--cc=mwalle@kernel.org \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=paul@crapouillou.net \
--cc=richard@nod.at \
--cc=stefan@agner.ch \
--cc=tudor.ambarus@linaro.org \
--cc=vigneshr@ti.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.