irqchip: crossbar: Dont use '0' to mark reserved interrupts
authorNishanth Menon <nm@ti.com>
Thu, 26 Jun 2014 07:10:19 +0000 (12:40 +0530)
committerJason Cooper <jason@lakedaemon.net>
Mon, 30 Jun 2014 19:11:16 +0000 (19:11 +0000)
Today '0' is actually reserved, but may not be the same in the future.

So, use a flag to mark the GIC interrupts that are reserved.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sricharan R <r.sricharan@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Link: https://lkml.kernel.org/r/1403766634-18543-2-git-send-email-r.sricharan@ti.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
drivers/irqchip/irq-crossbar.c

index 3d15d16a7088d2d886ef769f96534d896ded1b73..20105bcdf408121a3108b2731dae8e1454335d3c 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/irqchip/arm-gic.h>
 
 #define IRQ_FREE       -1
+#define IRQ_RESERVED   -2
 #define GIC_IRQ_START  32
 
 /*
@@ -139,7 +140,7 @@ static int __init crossbar_of_init(struct device_node *node)
                                pr_err("Invalid reserved entry\n");
                                goto err3;
                        }
-                       cb->irq_map[entry] = 0;
+                       cb->irq_map[entry] = IRQ_RESERVED;
                }
        }
 
@@ -170,7 +171,7 @@ static int __init crossbar_of_init(struct device_node *node)
         * reserved irqs. so find and store the offsets once.
         */
        for (i = 0; i < max; i++) {
-               if (!cb->irq_map[i])
+               if (cb->irq_map[i] == IRQ_RESERVED)
                        continue;
 
                cb->register_offsets[i] = reserved;