mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
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>
This commit is contained in:
parent
f8f5701bda
commit
bfd6185dde
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user