linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped()
@ 2026-01-05 13:33 Krzysztof Kozlowski
  2026-01-05 13:33 ` [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper Krzysztof Kozlowski
                   ` (10 more replies)
  0 siblings, 11 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, Jonathan Cameron, Krzysztof Kozlowski

Dependencies/merging
====================
1. First patch is a prerequisite for entire set, so either everything
   goes via same tree, the further patches wait a cycle or stable tag is
   shared from DT tree.

2. The last media patch depends on my earlier cleanup.

Description
===========
Simplify for_each_compatible_node() users with a new helper -
for_each_compatible_node_scoped().

Best regards,
Krzysztof

---
Krzysztof Kozlowski (11):
      of: Add for_each_compatible_node_scoped() helper
      ARM: at91: Simplify with scoped for each OF child loop
      ARM: exynos: Simplify with scoped for each OF child loop
      powerpc/fsp2: Simplify with scoped for each OF child loop
      powerpc/wii: Simplify with scoped for each OF child loop
      cdx: Simplify with scoped for each OF child loop
      clk: imx: imx27: Simplify with scoped for each OF child loop
      clk: imx: imx31: Simplify with scoped for each OF child loop
      dmaengine: fsl_raid: Simplify with scoped for each OF child loop
      media: samsung: exynos4-is: Simplify with scoped for each OF child loop
      cpufreq: s5pv210: Simplify with scoped for each OF child loop

 .clang-format                                       |  1 +
 arch/arm/mach-at91/pm.c                             |  7 ++-----
 arch/arm/mach-exynos/exynos.c                       |  8 ++------
 arch/powerpc/platforms/44x/fsp2.c                   |  5 +----
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c       |  4 +---
 drivers/cdx/cdx.c                                   |  4 +---
 drivers/clk/imx/clk-imx27.c                         |  7 ++-----
 drivers/clk/imx/clk-imx31.c                         |  7 ++-----
 drivers/cpufreq/s5pv210-cpufreq.c                   | 10 ++++------
 drivers/dma/fsl_raid.c                              |  4 +---
 drivers/media/platform/samsung/exynos4-is/fimc-is.c |  8 +++-----
 include/linux/of.h                                  |  7 +++++++
 12 files changed, 27 insertions(+), 45 deletions(-)
---
base-commit: 4d27ce1b1abefb22e277e715901cc52acdc5af2c
change-id: 20260105-of-for-each-compatible-scoped-285b3dbda253

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>



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

* [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-05 22:36   ` Rob Herring
  2026-01-06  9:54   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 02/11] ARM: at91: Simplify with scoped for each OF child loop Krzysztof Kozlowski
                   ` (9 subsequent siblings)
  10 siblings, 2 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, Jonathan Cameron, Krzysztof Kozlowski

Just like looping through children and available children, add a scoped
helper for for_each_compatible_node() so error paths can drop
of_node_put() leading to simpler code.

Suggested-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

---

Prerequisite for all further patches.
---
 .clang-format      | 1 +
 include/linux/of.h | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/.clang-format b/.clang-format
index c7060124a47a..1cc151e2adcc 100644
--- a/.clang-format
+++ b/.clang-format
@@ -259,6 +259,7 @@ ForEachMacros:
   - 'for_each_collection'
   - 'for_each_comp_order'
   - 'for_each_compatible_node'
+  - 'for_each_compatible_node_scoped'
   - 'for_each_component_dais'
   - 'for_each_component_dais_safe'
   - 'for_each_conduit'
diff --git a/include/linux/of.h b/include/linux/of.h
index 9bbdcf25a2b4..be6ec4916adf 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -1485,6 +1485,13 @@ static inline int of_property_read_s32(const struct device_node *np,
 #define for_each_compatible_node(dn, type, compatible) \
 	for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
 	     dn = of_find_compatible_node(dn, type, compatible))
+
+#define for_each_compatible_node_scoped(dn, type, compatible) \
+	for (struct device_node *dn __free(device_node) =		\
+	     of_find_compatible_node(NULL, type, compatible);		\
+	     dn;							\
+	     dn = of_find_compatible_node(dn, type, compatible))
+
 #define for_each_matching_node(dn, matches) \
 	for (dn = of_find_matching_node(NULL, matches); dn; \
 	     dn = of_find_matching_node(dn, matches))

-- 
2.51.0



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

* [PATCH 02/11] ARM: at91: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
  2026-01-05 13:33 ` [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-05 13:41   ` Nicolas Ferre
  2026-01-06 10:04   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 03/11] ARM: exynos: " Krzysztof Kozlowski
                   ` (8 subsequent siblings)
  10 siblings, 2 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, 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>

---

Depends on the first patch.
---
 arch/arm/mach-at91/pm.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 35058b99069c..68bb4a86cd94 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -982,15 +982,12 @@ static void __init at91_pm_sram_init(void)
 	struct gen_pool *sram_pool;
 	phys_addr_t sram_pbase;
 	unsigned long sram_base;
-	struct device_node *node;
 	struct platform_device *pdev = NULL;
 
-	for_each_compatible_node(node, NULL, "mmio-sram") {
+	for_each_compatible_node_scoped(node, NULL, "mmio-sram") {
 		pdev = of_find_device_by_node(node);
-		if (pdev) {
-			of_node_put(node);
+		if (pdev)
 			break;
-		}
 	}
 
 	if (!pdev) {

-- 
2.51.0



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

* [PATCH 03/11] ARM: exynos: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
  2026-01-05 13:33 ` [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper Krzysztof Kozlowski
  2026-01-05 13:33 ` [PATCH 02/11] ARM: at91: Simplify with scoped for each OF child loop Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-06 10:11   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 04/11] powerpc/fsp2: " Krzysztof Kozlowski
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, 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>

---

Depends on the first patch.
---
 arch/arm/mach-exynos/exynos.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 2e8099479ffa..18695076c34e 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -47,9 +47,7 @@ unsigned int exynos_rev(void)
 
 void __init exynos_sysram_init(void)
 {
-	struct device_node *node;
-
-	for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") {
+	for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram") {
 		struct resource res;
 		if (!of_device_is_available(node))
 			continue;
@@ -57,15 +55,13 @@ void __init exynos_sysram_init(void)
 		of_address_to_resource(node, 0, &res);
 		sysram_base_addr = ioremap(res.start, resource_size(&res));
 		sysram_base_phys = res.start;
-		of_node_put(node);
 		break;
 	}
 
-	for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") {
+	for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram-ns") {
 		if (!of_device_is_available(node))
 			continue;
 		sysram_ns_base_addr = of_iomap(node, 0);
-		of_node_put(node);
 		break;
 	}
 }

-- 
2.51.0



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

* [PATCH 04/11] powerpc/fsp2: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2026-01-05 13:33 ` [PATCH 03/11] ARM: exynos: " Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-06 10:12   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 05/11] powerpc/wii: " Krzysztof Kozlowski
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, 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>

---

Depends on the first patch.
---
 arch/powerpc/platforms/44x/fsp2.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/44x/fsp2.c b/arch/powerpc/platforms/44x/fsp2.c
index f6b8d02e08b0..b06d9220844c 100644
--- a/arch/powerpc/platforms/44x/fsp2.c
+++ b/arch/powerpc/platforms/44x/fsp2.c
@@ -199,16 +199,14 @@ static irqreturn_t rst_wrn_handler(int irq, void *data) {
 
 static void __init node_irq_request(const char *compat, irq_handler_t errirq_handler)
 {
-	struct device_node *np;
 	unsigned int irq;
 	int32_t rc;
 
-	for_each_compatible_node(np, NULL, compat) {
+	for_each_compatible_node_scoped(np, NULL, compat) {
 		irq = irq_of_parse_and_map(np, 0);
 		if (!irq) {
 			pr_err("device tree node %pOFn is missing a interrupt",
 			      np);
-			of_node_put(np);
 			return;
 		}
 
@@ -216,7 +214,6 @@ static void __init node_irq_request(const char *compat, irq_handler_t errirq_han
 		if (rc) {
 			pr_err("fsp_of_probe: request_irq failed: np=%pOF rc=%d",
 			      np, rc);
-			of_node_put(np);
 			return;
 		}
 	}

-- 
2.51.0



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

* [PATCH 05/11] powerpc/wii: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2026-01-05 13:33 ` [PATCH 04/11] powerpc/fsp2: " Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-06 10:14   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 06/11] cdx: " Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, 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>

---

Depends on the first patch.
---
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
index b57e87b0b3ce..1522a8bece29 100644
--- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
+++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c
@@ -201,11 +201,10 @@ unsigned int hlwd_pic_get_irq(void)
 void __init hlwd_pic_probe(void)
 {
 	struct irq_domain *host;
-	struct device_node *np;
 	const u32 *interrupts;
 	int cascade_virq;
 
-	for_each_compatible_node(np, NULL, "nintendo,hollywood-pic") {
+	for_each_compatible_node_scoped(np, NULL, "nintendo,hollywood-pic") {
 		interrupts = of_get_property(np, "interrupts", NULL);
 		if (interrupts) {
 			host = hlwd_pic_init(np);
@@ -215,7 +214,6 @@ void __init hlwd_pic_probe(void)
 			irq_set_chained_handler(cascade_virq,
 						hlwd_pic_irq_cascade);
 			hlwd_irq_host = host;
-			of_node_put(np);
 			break;
 		}
 	}

-- 
2.51.0



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

* [PATCH 06/11] cdx: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2026-01-05 13:33 ` [PATCH 05/11] powerpc/wii: " Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-06 10:17   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 07/11] clk: imx: imx27: " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  10 siblings, 1 reply; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, 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>

---

Depends on the first patch.
---
 drivers/cdx/cdx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
index b39af2f1937f..bbde529aaa93 100644
--- a/drivers/cdx/cdx.c
+++ b/drivers/cdx/cdx.c
@@ -608,7 +608,6 @@ static ssize_t rescan_store(const struct bus_type *bus,
 {
 	struct cdx_controller *cdx;
 	struct platform_device *pd;
-	struct device_node *np;
 	bool val;
 
 	if (kstrtobool(buf, &val) < 0)
@@ -623,10 +622,9 @@ static ssize_t rescan_store(const struct bus_type *bus,
 	cdx_unregister_devices(&cdx_bus_type);
 
 	/* Rescan all the devices */
-	for_each_compatible_node(np, NULL, compat_node_name) {
+	for_each_compatible_node_scoped(np, NULL, compat_node_name) {
 		pd = of_find_device_by_node(np);
 		if (!pd) {
-			of_node_put(np);
 			count = -EINVAL;
 			goto unlock;
 		}

-- 
2.51.0



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

* [PATCH 07/11] clk: imx: imx27: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2026-01-05 13:33 ` [PATCH 06/11] cdx: " Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-06  8:52   ` Peng Fan
  2026-01-06 10:21   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 08/11] clk: imx: imx31: " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  10 siblings, 2 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, 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>

---

Depends on first patch.
---
 drivers/clk/imx/clk-imx27.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/imx/clk-imx27.c b/drivers/clk/imx/clk-imx27.c
index 99618ded0939..f2f0d3fe5c52 100644
--- a/drivers/clk/imx/clk-imx27.c
+++ b/drivers/clk/imx/clk-imx27.c
@@ -171,17 +171,14 @@ static void __init _mx27_clocks_init(unsigned long fref)
 
 static void __init mx27_clocks_init_dt(struct device_node *np)
 {
-	struct device_node *refnp;
 	u32 fref = 26000000; /* default */
 
-	for_each_compatible_node(refnp, NULL, "fixed-clock") {
+	for_each_compatible_node_scoped(refnp, NULL, "fixed-clock") {
 		if (!of_device_is_compatible(refnp, "fsl,imx-osc26m"))
 			continue;
 
-		if (!of_property_read_u32(refnp, "clock-frequency", &fref)) {
-			of_node_put(refnp);
+		if (!of_property_read_u32(refnp, "clock-frequency", &fref))
 			break;
-		}
 	}
 
 	ccm = of_iomap(np, 0);

-- 
2.51.0



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

* [PATCH 08/11] clk: imx: imx31: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
                   ` (6 preceding siblings ...)
  2026-01-05 13:33 ` [PATCH 07/11] clk: imx: imx27: " Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-06  8:52   ` Peng Fan
  2026-01-06 10:23   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 09/11] dmaengine: fsl_raid: " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  10 siblings, 2 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, 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>

---

Depends on first patch.
---
 drivers/clk/imx/clk-imx31.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c
index 4c8d9ff0b2ad..962eccac63ce 100644
--- a/drivers/clk/imx/clk-imx31.c
+++ b/drivers/clk/imx/clk-imx31.c
@@ -123,18 +123,15 @@ static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref)
 
 static void __init mx31_clocks_init_dt(struct device_node *np)
 {
-	struct device_node *osc_np;
 	u32 fref = 26000000; /* default */
 	void __iomem *ccm;
 
-	for_each_compatible_node(osc_np, NULL, "fixed-clock") {
+	for_each_compatible_node_scoped(osc_np, NULL, "fixed-clock") {
 		if (!of_device_is_compatible(osc_np, "fsl,imx-osc26m"))
 			continue;
 
-		if (!of_property_read_u32(osc_np, "clock-frequency", &fref)) {
-			of_node_put(osc_np);
+		if (!of_property_read_u32(osc_np, "clock-frequency", &fref))
 			break;
-		}
 	}
 
 	ccm = of_iomap(np, 0);

-- 
2.51.0



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

* [PATCH 09/11] dmaengine: fsl_raid: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
                   ` (7 preceding siblings ...)
  2026-01-05 13:33 ` [PATCH 08/11] clk: imx: imx31: " Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-06 10:25   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 10/11] media: samsung: exynos4-is: " Krzysztof Kozlowski
  2026-01-05 13:33 ` [PATCH 11/11] cpufreq: s5pv210: " Krzysztof Kozlowski
  10 siblings, 1 reply; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, 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>

---

Depends on the first patch.
---
 drivers/dma/fsl_raid.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c
index 6aa97e258a55..6e6d7e0e475e 100644
--- a/drivers/dma/fsl_raid.c
+++ b/drivers/dma/fsl_raid.c
@@ -746,7 +746,6 @@ static int fsl_re_chan_probe(struct platform_device *ofdev,
 static int fsl_re_probe(struct platform_device *ofdev)
 {
 	struct fsl_re_drv_private *re_priv;
-	struct device_node *np;
 	struct device_node *child;
 	u32 off;
 	u8 ridx = 0;
@@ -823,11 +822,10 @@ static int fsl_re_probe(struct platform_device *ofdev)
 	dev_set_drvdata(dev, re_priv);
 
 	/* Parse Device tree to find out the total number of JQs present */
-	for_each_compatible_node(np, NULL, "fsl,raideng-v1.0-job-queue") {
+	for_each_compatible_node_scoped(np, NULL, "fsl,raideng-v1.0-job-queue") {
 		rc = of_property_read_u32(np, "reg", &off);
 		if (rc) {
 			dev_err(dev, "Reg property not found in JQ node\n");
-			of_node_put(np);
 			return -ENODEV;
 		}
 		/* Find out the Job Rings present under each JQ */

-- 
2.51.0



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

* [PATCH 10/11] media: samsung: exynos4-is: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
                   ` (8 preceding siblings ...)
  2026-01-05 13:33 ` [PATCH 09/11] dmaengine: fsl_raid: " Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-06 10:27   ` Jonathan Cameron
  2026-01-05 13:33 ` [PATCH 11/11] cpufreq: s5pv210: " Krzysztof Kozlowski
  10 siblings, 1 reply; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, Krzysztof Kozlowski

Use scoped for_each_compatible_node_scoped() loop when iterating over
device nodes to make code a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

---

Depends on the first patch and on:
https://lore.kernel.org/all/20260102124955.64904-2-krzysztof.kozlowski@oss.qualcomm.com/
---
 drivers/media/platform/samsung/exynos4-is/fimc-is.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
index 14d84cc96831..b7d9bfedd590 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c
@@ -200,21 +200,19 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index,
 
 static int fimc_is_register_subdevs(struct fimc_is *is)
 {
-	struct device_node *i2c_bus;
 	int ret, index = 0;
 
 	ret = fimc_isp_subdev_create(&is->isp);
 	if (ret < 0)
 		return ret;
 
-	for_each_compatible_node(i2c_bus, NULL, "samsung,exynos4212-i2c-isp") {
+	for_each_compatible_node_scoped(i2c_bus, NULL, "samsung,exynos4212-i2c-isp") {
 		for_each_available_child_of_node_scoped(i2c_bus, child) {
 			ret = fimc_is_parse_sensor_config(is, index, child);
 
-			if (ret < 0 || index >= FIMC_IS_SENSORS_NUM) {
-				of_node_put(i2c_bus);
+			if (ret < 0 || index >= FIMC_IS_SENSORS_NUM)
 				return ret;
-			}
+
 			index++;
 		}
 	}

-- 
2.51.0



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

* [PATCH 11/11] cpufreq: s5pv210: Simplify with scoped for each OF child loop
  2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
                   ` (9 preceding siblings ...)
  2026-01-05 13:33 ` [PATCH 10/11] media: samsung: exynos4-is: " Krzysztof Kozlowski
@ 2026-01-05 13:33 ` Krzysztof Kozlowski
  2026-01-06  4:57   ` Viresh Kumar
  2026-01-06 10:35   ` Jonathan Cameron
  10 siblings, 2 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-05 13:33 UTC (permalink / raw)
  To: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, Krzysztof Kozlowski

Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.  Note that there is another part of code using "np"
variable, so scoped loop should not shadow it.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

---

Depends on the first patch.
---
 drivers/cpufreq/s5pv210-cpufreq.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index ba8a1c96427a..e64e84e1ee79 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -629,19 +629,17 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
 		goto err_clock;
 	}
 
-	for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") {
-		id = of_alias_get_id(np, "dmc");
+	for_each_compatible_node_scoped(dmc, NULL, "samsung,s5pv210-dmc") {
+		id = of_alias_get_id(dmc, "dmc");
 		if (id < 0 || id >= ARRAY_SIZE(dmc_base)) {
-			dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", np);
-			of_node_put(np);
+			dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", dmc);
 			result = id;
 			goto err_clk_base;
 		}
 
-		dmc_base[id] = of_iomap(np, 0);
+		dmc_base[id] = of_iomap(dmc, 0);
 		if (!dmc_base[id]) {
 			dev_err(dev, "failed to map dmc%d registers\n", id);
-			of_node_put(np);
 			result = -EFAULT;
 			goto err_dmc;
 		}

-- 
2.51.0



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

* Re: [PATCH 02/11] ARM: at91: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 02/11] ARM: at91: Simplify with scoped for each OF child loop Krzysztof Kozlowski
@ 2026-01-05 13:41   ` Nicolas Ferre
  2026-01-06 10:04   ` Jonathan Cameron
  1 sibling, 0 replies; 30+ messages in thread
From: Nicolas Ferre @ 2026-01-05 13:41 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Miguel Ojeda, Rob Herring, Saravana Kannan,
	Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	Russell King, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar
  Cc: linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

Krzysztof,

On 05/01/2026 at 14:33, 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>

Thanks for handling this!
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Best regards,
   Nicolas

> ---
> 
> Depends on the first patch.
> ---
>   arch/arm/mach-at91/pm.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> index 35058b99069c..68bb4a86cd94 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -982,15 +982,12 @@ static void __init at91_pm_sram_init(void)
>          struct gen_pool *sram_pool;
>          phys_addr_t sram_pbase;
>          unsigned long sram_base;
> -       struct device_node *node;
>          struct platform_device *pdev = NULL;
> 
> -       for_each_compatible_node(node, NULL, "mmio-sram") {
> +       for_each_compatible_node_scoped(node, NULL, "mmio-sram") {
>                  pdev = of_find_device_by_node(node);
> -               if (pdev) {
> -                       of_node_put(node);
> +               if (pdev)
>                          break;
> -               }
>          }
> 
>          if (!pdev) {
> 
> --
> 2.51.0
> 



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

* Re: [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper
  2026-01-05 13:33 ` [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper Krzysztof Kozlowski
@ 2026-01-05 22:36   ` Rob Herring
  2026-01-06  7:10     ` Krzysztof Kozlowski
  2026-01-06  9:54   ` Jonathan Cameron
  1 sibling, 1 reply; 30+ messages in thread
From: Rob Herring @ 2026-01-05 22:36 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, Jonathan Cameron

On Mon, Jan 05, 2026 at 02:33:39PM +0100, Krzysztof Kozlowski wrote:
> Just like looping through children and available children, add a scoped
> helper for for_each_compatible_node() so error paths can drop
> of_node_put() leading to simpler code.
> 
> Suggested-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> 
> ---
> 
> Prerequisite for all further patches.
> ---
>  .clang-format      | 1 +
>  include/linux/of.h | 7 +++++++
>  2 files changed, 8 insertions(+)

You need to update scripts/dtc/dt-extract-compatibles

> 
> diff --git a/.clang-format b/.clang-format
> index c7060124a47a..1cc151e2adcc 100644
> --- a/.clang-format
> +++ b/.clang-format
> @@ -259,6 +259,7 @@ ForEachMacros:
>    - 'for_each_collection'
>    - 'for_each_comp_order'
>    - 'for_each_compatible_node'
> +  - 'for_each_compatible_node_scoped'
>    - 'for_each_component_dais'
>    - 'for_each_component_dais_safe'
>    - 'for_each_conduit'
> diff --git a/include/linux/of.h b/include/linux/of.h
> index 9bbdcf25a2b4..be6ec4916adf 100644
> --- a/include/linux/of.h
> +++ b/include/linux/of.h
> @@ -1485,6 +1485,13 @@ static inline int of_property_read_s32(const struct device_node *np,
>  #define for_each_compatible_node(dn, type, compatible) \
>  	for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
>  	     dn = of_find_compatible_node(dn, type, compatible))
> +
> +#define for_each_compatible_node_scoped(dn, type, compatible) \
> +	for (struct device_node *dn __free(device_node) =		\
> +	     of_find_compatible_node(NULL, type, compatible);		\
> +	     dn;							\
> +	     dn = of_find_compatible_node(dn, type, compatible))
> +
>  #define for_each_matching_node(dn, matches) \
>  	for (dn = of_find_matching_node(NULL, matches); dn; \
>  	     dn = of_find_matching_node(dn, matches))
> 
> -- 
> 2.51.0
> 


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

* Re: [PATCH 11/11] cpufreq: s5pv210: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 11/11] cpufreq: s5pv210: " Krzysztof Kozlowski
@ 2026-01-06  4:57   ` Viresh Kumar
  2026-01-06 10:35   ` Jonathan Cameron
  1 sibling, 0 replies; 30+ messages in thread
From: Viresh Kumar @ 2026-01-06  4:57 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On 05-01-26, 14:33, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.  Note that there is another part of code using "np"
> variable, so scoped loop should not shadow it.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> 
> ---
> 
> Depends on the first patch.
> ---
>  drivers/cpufreq/s5pv210-cpufreq.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
> index ba8a1c96427a..e64e84e1ee79 100644
> --- a/drivers/cpufreq/s5pv210-cpufreq.c
> +++ b/drivers/cpufreq/s5pv210-cpufreq.c
> @@ -629,19 +629,17 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
>  		goto err_clock;
>  	}
>  
> -	for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") {
> -		id = of_alias_get_id(np, "dmc");
> +	for_each_compatible_node_scoped(dmc, NULL, "samsung,s5pv210-dmc") {
> +		id = of_alias_get_id(dmc, "dmc");
>  		if (id < 0 || id >= ARRAY_SIZE(dmc_base)) {
> -			dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", np);
> -			of_node_put(np);
> +			dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", dmc);
>  			result = id;
>  			goto err_clk_base;
>  		}
>  
> -		dmc_base[id] = of_iomap(np, 0);
> +		dmc_base[id] = of_iomap(dmc, 0);
>  		if (!dmc_base[id]) {
>  			dev_err(dev, "failed to map dmc%d registers\n", id);
> -			of_node_put(np);
>  			result = -EFAULT;
>  			goto err_dmc;
>  		}
> 

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh


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

* Re: [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper
  2026-01-05 22:36   ` Rob Herring
@ 2026-01-06  7:10     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 30+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-06  7:10 UTC (permalink / raw)
  To: Rob Herring
  Cc: Miguel Ojeda, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm, Jonathan Cameron

On 05/01/2026 23:36, Rob Herring wrote:
> On Mon, Jan 05, 2026 at 02:33:39PM +0100, Krzysztof Kozlowski wrote:
>> Just like looping through children and available children, add a scoped
>> helper for for_each_compatible_node() so error paths can drop
>> of_node_put() leading to simpler code.
>>
>> Suggested-by: Jonathan Cameron <jonathan.cameron@huawei.com>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>>
>> ---
>>
>> Prerequisite for all further patches.
>> ---
>>  .clang-format      | 1 +
>>  include/linux/of.h | 7 +++++++
>>  2 files changed, 8 insertions(+)
> 
> You need to update scripts/dtc/dt-extract-compatibles

Right, ack.

Best regards,
Krzysztof


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

* RE: [PATCH 07/11] clk: imx: imx27: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 07/11] clk: imx: imx27: " Krzysztof Kozlowski
@ 2026-01-06  8:52   ` Peng Fan
  2026-01-06 10:21   ` Jonathan Cameron
  1 sibling, 0 replies; 30+ messages in thread
From: Peng Fan @ 2026-01-06  8:52 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Miguel Ojeda, Rob Herring, Saravana Kannan,
	Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	Russell King, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Michael Turquette,
	Stephen Boyd, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Vinod Koul, Sylwester Nawrocki,
	Mauro Carvalho Chehab, Rafael J. Wysocki, Viresh Kumar
  Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	llvm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-clk@vger.kernel.org, imx@lists.linux.dev,
	dmaengine@vger.kernel.org, linux-media@vger.kernel.org,
	linux-pm@vger.kernel.org

> Subject: [PATCH 07/11] clk: imx: imx27: Simplify with scoped for each
> OF child loop
> 
> 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>
> 

Reviewed-by: Peng Fan <peng.fan@nxp.com>

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

* RE: [PATCH 08/11] clk: imx: imx31: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 08/11] clk: imx: imx31: " Krzysztof Kozlowski
@ 2026-01-06  8:52   ` Peng Fan
  2026-01-06 10:23   ` Jonathan Cameron
  1 sibling, 0 replies; 30+ messages in thread
From: Peng Fan @ 2026-01-06  8:52 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Miguel Ojeda, Rob Herring, Saravana Kannan,
	Nathan Chancellor, Nick Desaulniers, Bill Wendling, Justin Stitt,
	Russell King, Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Michael Turquette,
	Stephen Boyd, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Vinod Koul, Sylwester Nawrocki,
	Mauro Carvalho Chehab, Rafael J. Wysocki, Viresh Kumar
  Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	llvm@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-clk@vger.kernel.org, imx@lists.linux.dev,
	dmaengine@vger.kernel.org, linux-media@vger.kernel.org,
	linux-pm@vger.kernel.org

> Subject: [PATCH 08/11] clk: imx: imx31: Simplify with scoped for each
> OF child loop
> 
> 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>
> 

Reviewed-by: Peng Fan <peng.fan@nxp.com>

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

* Re: [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper
  2026-01-05 13:33 ` [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper Krzysztof Kozlowski
  2026-01-05 22:36   ` Rob Herring
@ 2026-01-06  9:54   ` Jonathan Cameron
  1 sibling, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06  9:54 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:39 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> wrote:

> Just like looping through children and available children, add a scoped
> helper for for_each_compatible_node() so error paths can drop
> of_node_put() leading to simpler code.
> 
> Suggested-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>


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

* Re: [PATCH 02/11] ARM: at91: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 02/11] ARM: at91: Simplify with scoped for each OF child loop Krzysztof Kozlowski
  2026-01-05 13:41   ` Nicolas Ferre
@ 2026-01-06 10:04   ` Jonathan Cameron
  2026-01-06 10:06     ` Jonathan Cameron
  1 sibling, 1 reply; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:40 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> 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>
Interesting bit of code. I guess there is some history here that didn't
get captured as a comment?

> 
> ---
> 
> Depends on the first patch.
> ---
>  arch/arm/mach-at91/pm.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> index 35058b99069c..68bb4a86cd94 100644
> --- a/arch/arm/mach-at91/pm.c
> +++ b/arch/arm/mach-at91/pm.c
> @@ -982,15 +982,12 @@ static void __init at91_pm_sram_init(void)
>  	struct gen_pool *sram_pool;
>  	phys_addr_t sram_pbase;
>  	unsigned long sram_base;
> -	struct device_node *node;
>  	struct platform_device *pdev = NULL;
>  
> -	for_each_compatible_node(node, NULL, "mmio-sram") {
> +	for_each_compatible_node_scoped(node, NULL, "mmio-sram") {
>  		pdev = of_find_device_by_node(node);
> -		if (pdev) {
> -			of_node_put(node);
> +		if (pdev)
>  			break;
> -
		}
I'm curious if there are DT out there that ever causes the code to get to 
here?  There might be multiple mmio-sram nodes but if there were seems unlikely
the driver wants which ever one has a pdev at a given point in time.
That feels like a weird race condition. So in practice I'd expect this to
always either get the first one, or none.
e.g. Why this can't just be

node = of_find_node_by_name("mmio-sram);
if (node) {
	pdev = of_find_device_by_node(node);
}

or something along those lines.

Given risk of a regression maybe better to do what you have here.
So with that in mind
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

>  	}
>  
>  	if (!pdev) {
> 



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

* Re: [PATCH 02/11] ARM: at91: Simplify with scoped for each OF child loop
  2026-01-06 10:04   ` Jonathan Cameron
@ 2026-01-06 10:06     ` Jonathan Cameron
  0 siblings, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Tue, 6 Jan 2026 10:04:29 +0000
Jonathan Cameron <jonathan.cameron@huawei.com> wrote:

> On Mon, 05 Jan 2026 14:33:40 +0100
> Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> 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>  
> Interesting bit of code. I guess there is some history here that didn't
> get captured as a comment?
> 
> > 
> > ---
> > 
> > Depends on the first patch.
> > ---
> >  arch/arm/mach-at91/pm.c | 7 ++-----
> >  1 file changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
> > index 35058b99069c..68bb4a86cd94 100644
> > --- a/arch/arm/mach-at91/pm.c
> > +++ b/arch/arm/mach-at91/pm.c
> > @@ -982,15 +982,12 @@ static void __init at91_pm_sram_init(void)
> >  	struct gen_pool *sram_pool;
> >  	phys_addr_t sram_pbase;
> >  	unsigned long sram_base;
> > -	struct device_node *node;
> >  	struct platform_device *pdev = NULL;
> >  
> > -	for_each_compatible_node(node, NULL, "mmio-sram") {
> > +	for_each_compatible_node_scoped(node, NULL, "mmio-sram") {
> >  		pdev = of_find_device_by_node(node);
> > -		if (pdev) {
> > -			of_node_put(node);
> > +		if (pdev)
> >  			break;
> > -  
> 		}
> I'm curious if there are DT out there that ever causes the code to get to 
> here?  There might be multiple mmio-sram nodes but if there were seems unlikely
> the driver wants which ever one has a pdev at a given point in time.
> That feels like a weird race condition. So in practice I'd expect this to
> always either get the first one, or none.
> e.g. Why this can't just be
> 
> node = of_find_node_by_name("mmio-sram);
ah. Not name obviously.  Need more coffee.
of_find_compatible_node()

> if (node) {
> 	pdev = of_find_device_by_node(node);
> }
> 
> or something along those lines.
> 
> Given risk of a regression maybe better to do what you have here.
> So with that in mind
> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> 
> >  	}
> >  
> >  	if (!pdev) {
> >   
> 



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

* Re: [PATCH 03/11] ARM: exynos: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 03/11] ARM: exynos: " Krzysztof Kozlowski
@ 2026-01-06 10:11   ` Jonathan Cameron
  0 siblings, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:41 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> 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>
> 
> ---

A suggestion inline, but assuming you don't go with that, this is fine.
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

> 
> Depends on the first patch.
> ---
>  arch/arm/mach-exynos/exynos.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
> index 2e8099479ffa..18695076c34e 100644
> --- a/arch/arm/mach-exynos/exynos.c
> +++ b/arch/arm/mach-exynos/exynos.c
> @@ -47,9 +47,7 @@ unsigned int exynos_rev(void)
>  
>  void __init exynos_sysram_init(void)
>  {
> -	struct device_node *node;
> -
> -	for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") {
> +	for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram") {
>  		struct resource res;
>  		if (!of_device_is_available(node))
>  			continue;
No idea how common this pattern is, but maybe worth
	for_each_compatible_available_node_scoped() ?
Bit of a pain as you'd need a of_find_compatible_available_node() helper.
So I'll let you assess if there are enough instances of this to make it worthwhile.


> @@ -57,15 +55,13 @@ void __init exynos_sysram_init(void)
>  		of_address_to_resource(node, 0, &res);
>  		sysram_base_addr = ioremap(res.start, resource_size(&res));
>  		sysram_base_phys = res.start;
> -		of_node_put(node);
>  		break;
>  	}
>  
> -	for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") {
> +	for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram-ns") {
>  		if (!of_device_is_available(node))
>  			continue;
>  		sysram_ns_base_addr = of_iomap(node, 0);
> -		of_node_put(node);
>  		break;
>  	}
>  }
> 



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

* Re: [PATCH 04/11] powerpc/fsp2: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 04/11] powerpc/fsp2: " Krzysztof Kozlowski
@ 2026-01-06 10:12   ` Jonathan Cameron
  0 siblings, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:12 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:42 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> 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>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>


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

* Re: [PATCH 05/11] powerpc/wii: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 05/11] powerpc/wii: " Krzysztof Kozlowski
@ 2026-01-06 10:14   ` Jonathan Cameron
  0 siblings, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:43 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> 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>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>


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

* Re: [PATCH 06/11] cdx: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 06/11] cdx: " Krzysztof Kozlowski
@ 2026-01-06 10:17   ` Jonathan Cameron
  0 siblings, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:17 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:44 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> 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>
I'd be tempted to make one more tweak in this one to bring
it inline with the suggestions around not combining scoped cleanups
with gotos (see the comments in cleanup.h)

No bug here, just nice to have.
> 
> ---
> 
> Depends on the first patch.
> ---
>  drivers/cdx/cdx.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
> index b39af2f1937f..bbde529aaa93 100644
> --- a/drivers/cdx/cdx.c
> +++ b/drivers/cdx/cdx.c
> @@ -608,7 +608,6 @@ static ssize_t rescan_store(const struct bus_type *bus,
>  {
>  	struct cdx_controller *cdx;
>  	struct platform_device *pd;
> -	struct device_node *np;
>  	bool val;
>  
>  	if (kstrtobool(buf, &val) < 0)
> @@ -623,10 +622,9 @@ static ssize_t rescan_store(const struct bus_type *bus,
>  	cdx_unregister_devices(&cdx_bus_type);
>  
>  	/* Rescan all the devices */
> -	for_each_compatible_node(np, NULL, compat_node_name) {
> +	for_each_compatible_node_scoped(np, NULL, compat_node_name) {
>  		pd = of_find_device_by_node(np);
>  		if (!pd) {
> -			of_node_put(np);
>  			count = -EINVAL;
>  			goto unlock;
break instead.
Or better yet a follow up patch to use guard() for the mutex allowing a
direct return here.


>  		}
> 



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

* Re: [PATCH 07/11] clk: imx: imx27: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 07/11] clk: imx: imx27: " Krzysztof Kozlowski
  2026-01-06  8:52   ` Peng Fan
@ 2026-01-06 10:21   ` Jonathan Cameron
  1 sibling, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:21 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:45 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> 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>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
This is one that had me thinking for a (short) while about what pattern
required this double match was there for.  A comment would have been useful!

Ah well, nothing to do with your patch which is good.

Jonathan

> 
> ---
> 
> Depends on first patch.
> ---
>  drivers/clk/imx/clk-imx27.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/imx/clk-imx27.c b/drivers/clk/imx/clk-imx27.c
> index 99618ded0939..f2f0d3fe5c52 100644
> --- a/drivers/clk/imx/clk-imx27.c
> +++ b/drivers/clk/imx/clk-imx27.c
> @@ -171,17 +171,14 @@ static void __init _mx27_clocks_init(unsigned long fref)
>  
>  static void __init mx27_clocks_init_dt(struct device_node *np)
>  {
> -	struct device_node *refnp;
>  	u32 fref = 26000000; /* default */
>  
> -	for_each_compatible_node(refnp, NULL, "fixed-clock") {
> +	for_each_compatible_node_scoped(refnp, NULL, "fixed-clock") {
>  		if (!of_device_is_compatible(refnp, "fsl,imx-osc26m"))
>  			continue;
>  
> -		if (!of_property_read_u32(refnp, "clock-frequency", &fref)) {
> -			of_node_put(refnp);
> +		if (!of_property_read_u32(refnp, "clock-frequency", &fref))
>  			break;
> -		}
>  	}
>  
>  	ccm = of_iomap(np, 0);
> 



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

* Re: [PATCH 08/11] clk: imx: imx31: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 08/11] clk: imx: imx31: " Krzysztof Kozlowski
  2026-01-06  8:52   ` Peng Fan
@ 2026-01-06 10:23   ` Jonathan Cameron
  1 sibling, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:23 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:46 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> 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>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

I guess this is papering over similar compatibility issues with old DT
as the previous one (so fsl,imx-osc26m which may or may not have fallback
compatible to fixed-clock).

Jonathan

> 
> ---
> 
> Depends on first patch.
> ---
>  drivers/clk/imx/clk-imx31.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c
> index 4c8d9ff0b2ad..962eccac63ce 100644
> --- a/drivers/clk/imx/clk-imx31.c
> +++ b/drivers/clk/imx/clk-imx31.c
> @@ -123,18 +123,15 @@ static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref)
>  
>  static void __init mx31_clocks_init_dt(struct device_node *np)
>  {
> -	struct device_node *osc_np;
>  	u32 fref = 26000000; /* default */
>  	void __iomem *ccm;
>  
> -	for_each_compatible_node(osc_np, NULL, "fixed-clock") {
> +	for_each_compatible_node_scoped(osc_np, NULL, "fixed-clock") {
>  		if (!of_device_is_compatible(osc_np, "fsl,imx-osc26m"))
>  			continue;
>  
> -		if (!of_property_read_u32(osc_np, "clock-frequency", &fref)) {
> -			of_node_put(osc_np);
> +		if (!of_property_read_u32(osc_np, "clock-frequency", &fref))
>  			break;
> -		}
>  	}
>  
>  	ccm = of_iomap(np, 0);
> 



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

* Re: [PATCH 09/11] dmaengine: fsl_raid: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 09/11] dmaengine: fsl_raid: " Krzysztof Kozlowski
@ 2026-01-06 10:25   ` Jonathan Cameron
  0 siblings, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:25 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:47 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> 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>
> 
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>


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

* Re: [PATCH 10/11] media: samsung: exynos4-is: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 10/11] media: samsung: exynos4-is: " Krzysztof Kozlowski
@ 2026-01-06 10:27   ` Jonathan Cameron
  0 siblings, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:27 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:48 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> wrote:

> Use scoped for_each_compatible_node_scoped() loop when iterating over
> device nodes to make code a bit simpler.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>


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

* Re: [PATCH 11/11] cpufreq: s5pv210: Simplify with scoped for each OF child loop
  2026-01-05 13:33 ` [PATCH 11/11] cpufreq: s5pv210: " Krzysztof Kozlowski
  2026-01-06  4:57   ` Viresh Kumar
@ 2026-01-06 10:35   ` Jonathan Cameron
  1 sibling, 0 replies; 30+ messages in thread
From: Jonathan Cameron @ 2026-01-06 10:35 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Miguel Ojeda, Rob Herring, Saravana Kannan, Nathan Chancellor,
	Nick Desaulniers, Bill Wendling, Justin Stitt, Russell King,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
	Krzysztof Kozlowski, Alim Akhtar, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Nipun Gupta, Nikhil Agarwal, Abel Vesa, Peng Fan,
	Michael Turquette, Stephen Boyd, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Vinod Koul,
	Sylwester Nawrocki, Mauro Carvalho Chehab, Rafael J. Wysocki,
	Viresh Kumar, linux-kernel, devicetree, llvm, linux-arm-kernel,
	linux-samsung-soc, linuxppc-dev, linux-clk, imx, dmaengine,
	linux-media, linux-pm

On Mon, 05 Jan 2026 14:33:49 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> wrote:

> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.  Note that there is another part of code using "np"
> variable, so scoped loop should not shadow it.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Patch is fine so
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

Bit odd to use devm_ for a driver that has no real support for being unbound
(looks like it leaks everything if that happens) but to me it looks like
it might be worth doing anyway to allow direct returns in error
cases etc.  Anyhow, that's a much bigger looking project and would need
a devm_add_action_or_reset() for the final register and someone to test
it doesn't blow up if an unbind does happen.

One of the things I like about reviewing this sort of cleanup series
is it makes me look at a bunch of code I'd never normally go see ;)

Jonathan

> 
> ---
> 
> Depends on the first patch.
> ---
>  drivers/cpufreq/s5pv210-cpufreq.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
> index ba8a1c96427a..e64e84e1ee79 100644
> --- a/drivers/cpufreq/s5pv210-cpufreq.c
> +++ b/drivers/cpufreq/s5pv210-cpufreq.c
> @@ -629,19 +629,17 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
>  		goto err_clock;
>  	}
>  
> -	for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") {
> -		id = of_alias_get_id(np, "dmc");
> +	for_each_compatible_node_scoped(dmc, NULL, "samsung,s5pv210-dmc") {
> +		id = of_alias_get_id(dmc, "dmc");
>  		if (id < 0 || id >= ARRAY_SIZE(dmc_base)) {
> -			dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", np);
> -			of_node_put(np);
> +			dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", dmc);
>  			result = id;
>  			goto err_clk_base;
>  		}
>  
> -		dmc_base[id] = of_iomap(np, 0);
> +		dmc_base[id] = of_iomap(dmc, 0);
>  		if (!dmc_base[id]) {
>  			dev_err(dev, "failed to map dmc%d registers\n", id);
> -			of_node_put(np);
>  			result = -EFAULT;
>  			goto err_dmc;
>  		}
> 



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

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

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 13:33 [PATCH 00/11] of/treewide: Simplify with for_each_compatible_node_scoped() Krzysztof Kozlowski
2026-01-05 13:33 ` [PATCH 01/11] of: Add for_each_compatible_node_scoped() helper Krzysztof Kozlowski
2026-01-05 22:36   ` Rob Herring
2026-01-06  7:10     ` Krzysztof Kozlowski
2026-01-06  9:54   ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 02/11] ARM: at91: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2026-01-05 13:41   ` Nicolas Ferre
2026-01-06 10:04   ` Jonathan Cameron
2026-01-06 10:06     ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 03/11] ARM: exynos: " Krzysztof Kozlowski
2026-01-06 10:11   ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 04/11] powerpc/fsp2: " Krzysztof Kozlowski
2026-01-06 10:12   ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 05/11] powerpc/wii: " Krzysztof Kozlowski
2026-01-06 10:14   ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 06/11] cdx: " Krzysztof Kozlowski
2026-01-06 10:17   ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 07/11] clk: imx: imx27: " Krzysztof Kozlowski
2026-01-06  8:52   ` Peng Fan
2026-01-06 10:21   ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 08/11] clk: imx: imx31: " Krzysztof Kozlowski
2026-01-06  8:52   ` Peng Fan
2026-01-06 10:23   ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 09/11] dmaengine: fsl_raid: " Krzysztof Kozlowski
2026-01-06 10:25   ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 10/11] media: samsung: exynos4-is: " Krzysztof Kozlowski
2026-01-06 10:27   ` Jonathan Cameron
2026-01-05 13:33 ` [PATCH 11/11] cpufreq: s5pv210: " Krzysztof Kozlowski
2026-01-06  4:57   ` Viresh Kumar
2026-01-06 10:35   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).