diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-05 14:29:36 +0100 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-09-12 12:31:32 -0700 |
commit | 313ce80afd5b353732011f125fe2aa39fdf72279 (patch) | |
tree | b7f43808c57f7d673465c9d644d2c77bab0c47ce /drivers/base | |
parent | a8bdc44c56271ca33235e3c00b5b500c730d8346 (diff) |
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>
(cherry picked from commit bfd6185ddecc6e6f6bd654c053c307c9e49ca391)
Change-Id: I4f39385f1eb75af943cff001ba61efa5aa468942
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-on: http://git-master/r/131470
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/regmap/regmap-irq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c index c190229daa59..8e94e0ea38d3 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); |