mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
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>
This commit is contained in:
parent
1adce508e9
commit
e0af14088e
1 changed files with 1 additions and 4 deletions
|
|
@ -199,16 +199,14 @@ static irqreturn_t rst_wrn_handler(int irq, void *data) {
|
|||
|
||||
static void __init node_irq_request(const char *compat, irq_handler_t errirq_handler)
|
||||
{
|
||||
struct device_node *np;
|
||||
unsigned int irq;
|
||||
int32_t rc;
|
||||
|
||||
for_each_compatible_node(np, NULL, compat) {
|
||||
for_each_compatible_node_scoped(np, NULL, compat) {
|
||||
irq = irq_of_parse_and_map(np, 0);
|
||||
if (!irq) {
|
||||
pr_err("device tree node %pOFn is missing a interrupt",
|
||||
np);
|
||||
of_node_put(np);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -216,7 +214,6 @@ static void __init node_irq_request(const char *compat, irq_handler_t errirq_han
|
|||
if (rc) {
|
||||
pr_err("fsp_of_probe: request_irq failed: np=%pOF rc=%d",
|
||||
np, rc);
|
||||
of_node_put(np);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue