Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/fsp2: 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-4-c22fa2c0749a@oss.qualcomm.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Rob Herring (Arm)
e0af1408 1adce508

+1 -4
+1 -4
arch/powerpc/platforms/44x/fsp2.c
··· 199 199 200 200 static void __init node_irq_request(const char *compat, irq_handler_t errirq_handler) 201 201 { 202 - struct device_node *np; 203 202 unsigned int irq; 204 203 int32_t rc; 205 204 206 - for_each_compatible_node(np, NULL, compat) { 205 + for_each_compatible_node_scoped(np, NULL, compat) { 207 206 irq = irq_of_parse_and_map(np, 0); 208 207 if (!irq) { 209 208 pr_err("device tree node %pOFn is missing a interrupt", 210 209 np); 211 - of_node_put(np); 212 210 return; 213 211 } 214 212 ··· 214 216 if (rc) { 215 217 pr_err("fsp_of_probe: request_irq failed: np=%pOF rc=%d", 216 218 np, rc); 217 - of_node_put(np); 218 219 return; 219 220 } 220 221 }