Skip to content

Commit 9572933

Browse files
krzkrobherring
authored andcommitted
powerpc/wii: Simplify with scoped for each OF child loop
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 <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org> Link: https://patch.msgid.link/20260109-of-for-each-compatible-scoped-v3-5-c22fa2c0749a@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
1 parent e0af140 commit 9572933

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

arch/powerpc/platforms/embedded6xx/hlwd-pic.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,10 @@ unsigned int hlwd_pic_get_irq(void)
201201
void __init hlwd_pic_probe(void)
202202
{
203203
struct irq_domain *host;
204-
struct device_node *np;
205204
const u32 *interrupts;
206205
int cascade_virq;
207206

208-
for_each_compatible_node(np, NULL, "nintendo,hollywood-pic") {
207+
for_each_compatible_node_scoped(np, NULL, "nintendo,hollywood-pic") {
209208
interrupts = of_get_property(np, "interrupts", NULL);
210209
if (interrupts) {
211210
host = hlwd_pic_init(np);
@@ -215,7 +214,6 @@ void __init hlwd_pic_probe(void)
215214
irq_set_chained_handler(cascade_virq,
216215
hlwd_pic_irq_cascade);
217216
hlwd_irq_host = host;
218-
of_node_put(np);
219217
break;
220218
}
221219
}

0 commit comments

Comments
 (0)