MIPS: RB532: Convert to new irq_chip functions
authorThomas Gleixner <tglx@linutronix.de>
Wed, 23 Mar 2011 21:09:10 +0000 (21:09 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 25 Mar 2011 17:45:19 +0000 (18:45 +0100)
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2201/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/rb532/irq.c

index ea6cec3..b32a768 100644 (file)
@@ -111,10 +111,10 @@ static inline void ack_local_irq(unsigned int ip)
        clear_c0_cause(ipnum);
 }
 
-static void rb532_enable_irq(unsigned int irq_nr)
+static void rb532_enable_irq(struct irq_data *d)
 {
+       unsigned int group, intr_bit, irq_nr = d->irq;
        int ip = irq_nr - GROUP0_IRQ_BASE;
-       unsigned int group, intr_bit;
        volatile unsigned int *addr;
 
        if (ip < 0)
@@ -132,10 +132,10 @@ static void rb532_enable_irq(unsigned int irq_nr)
        }
 }
 
-static void rb532_disable_irq(unsigned int irq_nr)
+static void rb532_disable_irq(struct irq_data *d)
 {
+       unsigned int group, intr_bit, mask, irq_nr = d->irq;
        int ip = irq_nr - GROUP0_IRQ_BASE;
-       unsigned int group, intr_bit, mask;
        volatile unsigned int *addr;
 
        if (ip < 0) {
@@ -163,18 +163,18 @@ static void rb532_disable_irq(unsigned int irq_nr)
        }
 }
 
-static void rb532_mask_and_ack_irq(unsigned int irq_nr)
+static void rb532_mask_and_ack_irq(struct irq_data *d)
 {
-       rb532_disable_irq(irq_nr);
-       ack_local_irq(group_to_ip(irq_to_group(irq_nr)));
+       rb532_disable_irq(d);
+       ack_local_irq(group_to_ip(irq_to_group(d->irq)));
 }
 
-static int rb532_set_type(unsigned int irq_nr, unsigned type)
+static int rb532_set_type(struct irq_data *d,  unsigned type)
 {
-       int gpio = irq_nr - GPIO_MAPPED_IRQ_BASE;
-       int group = irq_to_group(irq_nr);
+       int gpio = d->irq - GPIO_MAPPED_IRQ_BASE;
+       int group = irq_to_group(d->irq);
 
-       if (group != GPIO_MAPPED_IRQ_GROUP || irq_nr > (GROUP4_IRQ_BASE + 13))
+       if (group != GPIO_MAPPED_IRQ_GROUP || d->irq > (GROUP4_IRQ_BASE + 13))
                return (type == IRQ_TYPE_LEVEL_HIGH) ? 0 : -EINVAL;
 
        switch (type) {
@@ -193,11 +193,11 @@ static int rb532_set_type(unsigned int irq_nr, unsigned type)
 
 static struct irq_chip rc32434_irq_type = {
        .name           = "RB532",
-       .ack            = rb532_disable_irq,
-       .mask           = rb532_disable_irq,
-       .mask_ack       = rb532_mask_and_ack_irq,
-       .unmask         = rb532_enable_irq,
-       .set_type       = rb532_set_type,
+       .irq_ack        = rb532_disable_irq,
+       .irq_mask       = rb532_disable_irq,
+       .irq_mask_ack   = rb532_mask_and_ack_irq,
+       .irq_unmask     = rb532_enable_irq,
+       .irq_set_type   = rb532_set_type,
 };
 
 void __init arch_init_irq(void)