public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regmap-irq: allow auto-allocated IRQs to be mapped
@ 2012-08-01 18:05 Anthony Olech
  0 siblings, 0 replies; 9+ messages in thread
From: Anthony Olech @ 2012-08-01 18:05 UTC (permalink / raw)
  To: LKML; +Cc: Anthony Olech, Dajun Chen

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.

Signed-off-by: Anthony Olech (Opensource) <anthony.olech.opensource@diasemi.com>
---
 drivers/base/regmap/regmap-irq.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index a897346..2441785 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -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);
-- 
end-of-patch for regmap-irq-bug-fix


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-08-08  8:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201208020805.q72858Yj003147@latitude.olech.com>
2012-08-04 10:54 ` [PATCH] regmap-irq: allow auto-allocated IRQs to be mapped Mark Brown
2012-08-05 19:57   ` Opensource [Anthony Olech]
2012-08-06 12:20     ` Mark Brown
2012-08-07 11:18   ` Opensource [Anthony Olech]
2012-08-07 14:03     ` Mark Brown
2012-08-07 14:37       ` Opensource [Anthony Olech]
2012-08-07 17:02         ` Mark Brown
2012-08-08  8:30           ` Opensource [Anthony Olech]
2012-08-01 18:05 Anthony Olech

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox