Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

microblaze: Convert irq_chip to new functions

Use proper irq_desc wrappers while at it.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michal Simek <monstr@monstr.eu>

authored by

Thomas Gleixner and committed by
Michal Simek
6f205a4c 208a34f5

+26 -24
+19 -19
arch/microblaze/kernel/intc.c
··· 40 40 #define MER_ME (1<<0) 41 41 #define MER_HIE (1<<1) 42 42 43 - static void intc_enable_or_unmask(unsigned int irq) 43 + static void intc_enable_or_unmask(struct irq_data *d) 44 44 { 45 - unsigned long mask = 1 << irq; 46 - pr_debug("enable_or_unmask: %d\n", irq); 45 + unsigned long mask = 1 << d->irq; 46 + pr_debug("enable_or_unmask: %d\n", d->irq); 47 47 out_be32(INTC_BASE + SIE, mask); 48 48 49 49 /* ack level irqs because they can't be acked during 50 50 * ack function since the handle_level_irq function 51 51 * acks the irq before calling the interrupt handler 52 52 */ 53 - if (irq_desc[irq].status & IRQ_LEVEL) 53 + if (irq_to_desc(d->irq)->status & IRQ_LEVEL) 54 54 out_be32(INTC_BASE + IAR, mask); 55 55 } 56 56 57 - static void intc_disable_or_mask(unsigned int irq) 57 + static void intc_disable_or_mask(struct irq_data *d) 58 58 { 59 - pr_debug("disable: %d\n", irq); 60 - out_be32(INTC_BASE + CIE, 1 << irq); 59 + pr_debug("disable: %d\n", d->irq); 60 + out_be32(INTC_BASE + CIE, 1 << d->irq); 61 61 } 62 62 63 - static void intc_ack(unsigned int irq) 63 + static void intc_ack(struct irq_data *d) 64 64 { 65 - pr_debug("ack: %d\n", irq); 66 - out_be32(INTC_BASE + IAR, 1 << irq); 65 + pr_debug("ack: %d\n", d->irq); 66 + out_be32(INTC_BASE + IAR, 1 << d->irq); 67 67 } 68 68 69 - static void intc_mask_ack(unsigned int irq) 69 + static void intc_mask_ack(struct irq_data *d) 70 70 { 71 - unsigned long mask = 1 << irq; 72 - pr_debug("disable_and_ack: %d\n", irq); 71 + unsigned long mask = 1 << d->irq; 72 + pr_debug("disable_and_ack: %d\n", d->irq); 73 73 out_be32(INTC_BASE + CIE, mask); 74 74 out_be32(INTC_BASE + IAR, mask); 75 75 } 76 76 77 77 static struct irq_chip intc_dev = { 78 78 .name = "Xilinx INTC", 79 - .unmask = intc_enable_or_unmask, 80 - .mask = intc_disable_or_mask, 81 - .ack = intc_ack, 82 - .mask_ack = intc_mask_ack, 79 + .irq_unmask = intc_enable_or_unmask, 80 + .irq_mask = intc_disable_or_mask, 81 + .irq_ack = intc_ack, 82 + .irq_mask_ack = intc_mask_ack, 83 83 }; 84 84 85 85 unsigned int get_irq(struct pt_regs *regs) ··· 159 159 if (intr_type & (0x00000001 << i)) { 160 160 set_irq_chip_and_handler_name(i, &intc_dev, 161 161 handle_edge_irq, intc_dev.name); 162 - irq_desc[i].status &= ~IRQ_LEVEL; 162 + irq_clear_status_flags(i, IRQ_LEVEL); 163 163 } else { 164 164 set_irq_chip_and_handler_name(i, &intc_dev, 165 165 handle_level_irq, intc_dev.name); 166 - irq_desc[i].status |= IRQ_LEVEL; 166 + irq_set_status_flags(i, IRQ_LEVEL); 167 167 } 168 168 } 169 169 }
+7 -5
arch/microblaze/kernel/irq.c
··· 50 50 int show_interrupts(struct seq_file *p, void *v) 51 51 { 52 52 int i = *(loff_t *) v, j; 53 + struct irq_desc *desc; 53 54 struct irqaction *action; 54 55 unsigned long flags; 55 56 ··· 62 61 } 63 62 64 63 if (i < nr_irq) { 65 - raw_spin_lock_irqsave(&irq_desc[i].lock, flags); 66 - action = irq_desc[i].action; 64 + desc = irq_to_desc(i); 65 + raw_spin_lock_irqsave(&desc->lock, flags); 66 + action = desc->action; 67 67 if (!action) 68 68 goto skip; 69 69 seq_printf(p, "%3d: ", i); ··· 74 72 for_each_online_cpu(j) 75 73 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 76 74 #endif 77 - seq_printf(p, " %8s", irq_desc[i].status & 75 + seq_printf(p, " %8s", desc->status & 78 76 IRQ_LEVEL ? "level" : "edge"); 79 - seq_printf(p, " %8s", irq_desc[i].chip->name); 77 + seq_printf(p, " %8s", desc->irq_data.chip->name); 80 78 seq_printf(p, " %s", action->name); 81 79 82 80 for (action = action->next; action; action = action->next) ··· 84 82 85 83 seq_putc(p, '\n'); 86 84 skip: 87 - raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); 85 + raw_spin_unlock_irqrestore(&desc->lock, flags); 88 86 } 89 87 return 0; 90 88 }