aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/gpio.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-01-05 01:46:18 -0500
committerKevin Hilman <khilman@ti.com>2011-01-07 16:33:08 -0500
commit1a9b5878671d417a856fdafe971306c99297b7f0 (patch)
tree36081197314bd24eccc01d240b64275b944ca46d /arch/arm/plat-omap/gpio.c
parentb97c374d8a44292c601146783aac61f3d5d1f46f (diff)
arm: omap: gpio: don't access irq_desc array directly
Instead of accessing the irq_desc array directly we can use irq_to_desc(irq). That will allow us to, if wanted, select SPARSE_IRQ and irq_descs will be added to a radix tree, instead of a array. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/plat-omap/gpio.c')
-rw-r--r--arch/arm/plat-omap/gpio.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 60631f227797..ccf2660f4151 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -756,8 +756,10 @@ static int gpio_irq_type(unsigned irq, unsigned type)
756 spin_lock_irqsave(&bank->lock, flags); 756 spin_lock_irqsave(&bank->lock, flags);
757 retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type); 757 retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type);
758 if (retval == 0) { 758 if (retval == 0) {
759 irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK; 759 struct irq_desc *d = irq_to_desc(irq);
760 irq_desc[irq].status |= type; 760
761 d->status &= ~IRQ_TYPE_SENSE_MASK;
762 d->status |= type;
761 } 763 }
762 spin_unlock_irqrestore(&bank->lock, flags); 764 spin_unlock_irqrestore(&bank->lock, flags);
763 765
@@ -1671,7 +1673,9 @@ static void __init omap_gpio_chip_init(struct gpio_bank *bank)
1671 1673
1672 for (j = bank->virtual_irq_start; 1674 for (j = bank->virtual_irq_start;
1673 j < bank->virtual_irq_start + bank_width; j++) { 1675 j < bank->virtual_irq_start + bank_width; j++) {
1674 lockdep_set_class(&irq_desc[j].lock, &gpio_lock_class); 1676 struct irq_desc *d = irq_to_desc(j);
1677
1678 lockdep_set_class(&d->lock, &gpio_lock_class);
1675 set_irq_chip_data(j, bank); 1679 set_irq_chip_data(j, bank);
1676 if (bank_is_mpuio(bank)) 1680 if (bank_is_mpuio(bank))
1677 set_irq_chip(j, &mpuio_irq_chip); 1681 set_irq_chip(j, &mpuio_irq_chip);