Skip to contentSkip to conversation

regmap-irq: allow auto-allocated IRQs to be mapped

PATCH New Anthony Olech (Opensource) 1 participant 1 message Aug 1, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 regmap-irq: allow auto-allocated IRQs to be mapped

if the irq_base is set to -1 when calling regmap_add_irq_chip() then allow the IRQ to be mapped even if the allocated irq_base is actually zero.

This restores the behaviour seen in v3.4, and I assume that the tidy-ups just made in v3.5 INADVERTENTLY introduce this change in behaviour.

---
 drivers/base/regmap/regmap-irq.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/base/regmap/regmap-irq.c +2 -1
index a897346..2441785 100644
@@ -238,6 +238,7 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
 	struct regmap_irq_chip_data *d;
 	int i;
 	int ret = -ENOMEM;
+	int orig_irq_base = irq_base;
 
 	for (i = 0; i < chip->num_irqs; i++) {
 		if (chip->irqs[i].reg_offset % map->reg_stride)
@@ -313,7 +314,7 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
 		}
 	}
 
-	if (irq_base)
+	if (irq_base || orig_irq_base)
 		d->domain = irq_domain_add_legacy(map->dev->of_node,
 						  chip->num_irqs, irq_base, 0,
 						  &regmap_domain_ops, d);
Signature · 1 line
end-of-patch for regmap-irq-bug-fix