Skip to content

Commit e0af140

Browse files
krzkrobherring
authored andcommitted
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>
1 parent 1adce50 commit e0af140

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • arch/powerpc/platforms/44x

arch/powerpc/platforms/44x/fsp2.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,24 +199,21 @@ static irqreturn_t rst_wrn_handler(int irq, void *data) {
199199

200200
static void __init node_irq_request(const char *compat, irq_handler_t errirq_handler)
201201
{
202-
struct device_node *np;
203202
unsigned int irq;
204203
int32_t rc;
205204

206-
for_each_compatible_node(np, NULL, compat) {
205+
for_each_compatible_node_scoped(np, NULL, compat) {
207206
irq = irq_of_parse_and_map(np, 0);
208207
if (!irq) {
209208
pr_err("device tree node %pOFn is missing a interrupt",
210209
np);
211-
of_node_put(np);
212210
return;
213211
}
214212

215213
rc = request_irq(irq, errirq_handler, 0, np->name, np);
216214
if (rc) {
217215
pr_err("fsp_of_probe: request_irq failed: np=%pOF rc=%d",
218216
np, rc);
219-
of_node_put(np);
220217
return;
221218
}
222219
}

0 commit comments

Comments
 (0)