summaryrefslogtreecommitdiff
path: root/drivers/base/regmap
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-05 13:29:36 (GMT)
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-05 13:38:20 (GMT)
commitbfd6185ddecc6e6f6bd654c053c307c9e49ca391 (patch)
tree0374aabdf423ae10df80d4d2ecd2cb1f82507a1d /drivers/base/regmap
parentf8f5701bdaf9134b1f90e5044a82c66324d2073f (diff)
downloadlinux-fsl-qoriq-bfd6185ddecc6e6f6bd654c053c307c9e49ca391.tar.xz
regmap: Don't try to map non-existant IRQs
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>
Diffstat (limited to 'drivers/base/regmap')
-rw-r--r--drivers/base/regmap/regmap-irq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index 4fac4b9..b74e14c 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -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);