Thread (19 messages) 19 messages, 5 authors, 2026-01-29

Re: [PATCH v3 05/12] powerpc/wii: Simplify with scoped for each OF child loop

From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Date: 2026-01-09 17:22:35
Also in: dmaengine, imx, linux-arm-kernel, linux-clk, linux-devicetree, linux-media, linux-pm, linux-samsung-soc, lkml, llvm


Le 09/01/2026 à 17:57, Krzysztof Kozlowski a écrit :
Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Krzysztof Kozlowski <redacted>
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
quoted hunk ↗ jump to hunk
---

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;
  		}
  	}
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help