regmap: Dynamicallly allocate a regmap_irq range if no base is specified
Subsystems (2)
PATCH 1/1 regmap: Dynamicallly allocate a regmap_irq range if no base is specified
This avoids drivers having to implement the logic and will make it easier to add irq_domain support.
Signed-off-by Mark Brown <[email protected]>
--- drivers/base/regmap/regmap-irq.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/base/regmap/regmap-irq.c +4 -0
@@ -195,6 +195,10 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,return -EINVAL ; } +/* Ask for a dynamic range if none is specified */ +if (!irq_base) + irq_base =-1 ; + irq_base =irq_alloc_descs (irq_base,0 , chip->num_irqs,0 );if (irq_base <0 ) { dev_warn(map->dev, "Failed to allocate IRQs: %d\n",
Signature · 1 line
1.7.10