of: irq: fix of_irq_to_resource() error check
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Fri, 21 Jul 2017 17:30:39 +0000 (20:30 +0300)
committerRob Herring <robh@kernel.org>
Fri, 21 Jul 2017 21:58:55 +0000 (16:58 -0500)
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: 7a4228bbff76 ("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>
drivers/of/irq.c

index 6ce72aa..ab21c84 100644 (file)
@@ -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;