Skip to contentSkip to conversation

regmap: Dynamicallly allocate a regmap_irq range if no base is specified

PATCH New Mark Brown 1 participant 1 message May 13, 2012

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

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.

---
 drivers/base/regmap/regmap-irq.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/base/regmap/regmap-irq.c +4 -0
index 0d233cc..f9724af 100644
@@ -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