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 <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>

Reviewed-by: Christophe Leroy (CS GROUP) <[email protected]>

---

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;
                }
        }



Reply via email to