Commit 1a9b5878 authored by Felipe Balbi's avatar Felipe Balbi Committed by Kevin Hilman

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: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
parent b97c374d
...@@ -756,8 +756,10 @@ static int gpio_irq_type(unsigned irq, unsigned type) ...@@ -756,8 +756,10 @@ static int gpio_irq_type(unsigned irq, unsigned type)
spin_lock_irqsave(&bank->lock, flags); spin_lock_irqsave(&bank->lock, flags);
retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type); retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type);
if (retval == 0) { if (retval == 0) {
irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK; struct irq_desc *d = irq_to_desc(irq);
irq_desc[irq].status |= type;
d->status &= ~IRQ_TYPE_SENSE_MASK;
d->status |= type;
} }
spin_unlock_irqrestore(&bank->lock, flags); spin_unlock_irqrestore(&bank->lock, flags);
...@@ -1671,7 +1673,9 @@ static void __init omap_gpio_chip_init(struct gpio_bank *bank) ...@@ -1671,7 +1673,9 @@ static void __init omap_gpio_chip_init(struct gpio_bank *bank)
for (j = bank->virtual_irq_start; for (j = bank->virtual_irq_start;
j < bank->virtual_irq_start + bank_width; j++) { j < bank->virtual_irq_start + bank_width; j++) {
lockdep_set_class(&irq_desc[j].lock, &gpio_lock_class); struct irq_desc *d = irq_to_desc(j);
lockdep_set_class(&d->lock, &gpio_lock_class);
set_irq_chip_data(j, bank); set_irq_chip_data(j, bank);
if (bank_is_mpuio(bank)) if (bank_is_mpuio(bank))
set_irq_chip(j, &mpuio_irq_chip); set_irq_chip(j, &mpuio_irq_chip);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment