Thread (1 message) 1 message, 1 author, 2011-12-05

[PATCH 2/2] gpio/tegra: Dynamically allocate IRQ base, and support DT

From: Shawn Guo <hidden>
Date: 2011-12-05 06:55:28
Also in: linux-devicetree, linux-tegra

On Wed, Nov 30, 2011 at 05:45:36PM -0700, Stephen Warren wrote:
[...]
 static void tegra_gpio_irq_ack(struct irq_data *d)
 {
-	int gpio = d->irq - INT_GPIO_BASE;
+	int gpio = d->hwirq;
 
Though it's working right now, I'm not sure it's safe enough.  This
only works when d->hwirq_base is 0, which is true for now.  But I doubt
it will be always true.  I guess hwirq_base was introduced there for
some reason.  When some day irqdomain starts using this field, the
above code starts being broken.  IMO, the way that generic-chip.c is
using to calculate the number, d->irq - gc->irq_base, is much more
safer.

-- 
Regards,
Shawn
 	tegra_gpio_writel(1 << GPIO_BIT(gpio), GPIO_INT_CLR(gpio));
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help