public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] mtd: rawnand: brcm: Simplify with scoped for each OF child loop
@ 2026-01-02 12:49 Krzysztof Kozlowski
  2026-01-02 12:49 ` [PATCH 2/7] mtd: rawnand: denali: " Krzysztof Kozlowski
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-02 12:49 UTC (permalink / raw)
  To: Brian Norris, Kamal Dasu, Broadcom internal kernel review list,
	Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Harvey Hunt, Paul Cercueil, Manivannan Sadhasivam, Stefan Agner,
	Tudor Ambarus, Pratyush Yadav, Michael Walle, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, linux-mtd,
	linux-kernel, linux-mips, linux-arm-msm, llvm
  Cc: Krzysztof Kozlowski

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/mtd/nand/raw/brcmnand/brcmnand.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index 835653bdd5ab..0427d76f45d0 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -3298,7 +3298,7 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
 {
 	struct brcmnand_platform_data *pd = dev_get_platdata(&pdev->dev);
 	struct device *dev = &pdev->dev;
-	struct device_node *dn = dev->of_node, *child;
+	struct device_node *dn = dev->of_node;
 	struct brcmnand_controller *ctrl;
 	struct brcmnand_host *host;
 	struct resource *res;
@@ -3486,12 +3486,11 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
 		}
 	}
 
-	for_each_available_child_of_node(dn, child) {
+	for_each_available_child_of_node_scoped(dn, child) {
 		if (of_device_is_compatible(child, "brcm,nandcs")) {
 
 			host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
 			if (!host) {
-				of_node_put(child);
 				ret = -ENOMEM;
 				goto err;
 			}
@@ -3509,10 +3508,9 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
 
 			ret = brcmnand_init_cs(host, NULL);
 			if (ret) {
-				if (ret == -EPROBE_DEFER) {
-					of_node_put(child);
+				if (ret == -EPROBE_DEFER)
 					goto err;
-				}
+
 				devm_kfree(dev, host);
 				continue; /* Try all chip-selects */
 			}
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-01-19 10:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/7] mtd: rawnand: denali: " Krzysztof Kozlowski
2026-01-02 12:49 ` [PATCH 3/7] mtd: rawnand: ingenic: " Krzysztof Kozlowski
2026-01-02 22:22   ` Paul Cercueil
2026-01-02 12:49 ` [PATCH 4/7] mtd: rawnand: qcom: " Krzysztof Kozlowski
2026-01-02 13:59   ` Konrad Dybcio
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 ` [PATCH 6/7] mtd: rawnand: vf610: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-01-02 12:49 ` [PATCH 7/7] mtd: spi-nor: hisi-sfc: " Krzysztof Kozlowski
2026-01-02 13:33   ` Pratyush Yadav
2026-01-03 12:38     ` Krzysztof Kozlowski
2026-01-03 23:28       ` Pratyush Yadav
2026-01-03 23:57       ` Vladimir Zapolskiy
2026-01-19 10:14 ` [PATCH 1/7] mtd: rawnand: brcm: " Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox