Skip to content

Commit

Permalink
of: irq: fix of_irq_to_resource() error check
Browse files Browse the repository at this point in the history
of_irq_to_resource() has recently been fixed to return negative error #'s
along with 0, however of_irq_to_resource_table() still only regards 0 as
invalid IRQ -- fix it up.

Fixes: 7a4228b ("of: irq: use of_irq_get() in of_irq_to_resource()")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
Sergei Shtylyov authored and Rob Herring committed Jul 21, 2017
1 parent b4b201d commit 531da74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/of/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ int of_irq_to_resource_table(struct device_node *dev, struct resource *res,
int i;

for (i = 0; i < nr_irqs; i++, res++)
if (!of_irq_to_resource(dev, i, res))
if (of_irq_to_resource(dev, i, res) <= 0)
break;

return i;
Expand Down

0 comments on commit 531da74

Please sign in to comment.