]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
regmap: Don't try to map non-existant IRQs
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 5 Jun 2012 13:29:36 +0000 (14:29 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 5 Jun 2012 13:38:20 +0000 (14:38 +0100)
If the driver supplied an empty entry in the array of IRQs then return
an error rather than trying to do the mapping. This is intended for use
with handling chip variants and similar situations.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/base/regmap/regmap-irq.c

index 4fac4b9be88f7ca5b7144396e5908b5b8f1bb593..b74e14c4dff44717f2be8f063be995fceb8e3105 100644 (file)
@@ -346,6 +346,10 @@ EXPORT_SYMBOL_GPL(regmap_irq_chip_get_base);
  */
 int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq)
 {
+       /* Handle holes in the IRQ list */
+       if (!data->chip->irqs[irq].mask)
+               return -EINVAL;
+
        return irq_create_mapping(data->domain, irq);
 }
 EXPORT_SYMBOL_GPL(regmap_irq_get_virq);