Commit 6f205a4c authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Michal Simek

microblaze: Convert irq_chip to new functions

Use proper irq_desc wrappers while at it.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent 208a34f5
...@@ -40,46 +40,46 @@ unsigned int nr_irq; ...@@ -40,46 +40,46 @@ unsigned int nr_irq;
#define MER_ME (1<<0) #define MER_ME (1<<0)
#define MER_HIE (1<<1) #define MER_HIE (1<<1)
static void intc_enable_or_unmask(unsigned int irq) static void intc_enable_or_unmask(struct irq_data *d)
{ {
unsigned long mask = 1 << irq; unsigned long mask = 1 << d->irq;
pr_debug("enable_or_unmask: %d\n", irq); pr_debug("enable_or_unmask: %d\n", d->irq);
out_be32(INTC_BASE + SIE, mask); out_be32(INTC_BASE + SIE, mask);
/* ack level irqs because they can't be acked during /* ack level irqs because they can't be acked during
* ack function since the handle_level_irq function * ack function since the handle_level_irq function
* acks the irq before calling the interrupt handler * acks the irq before calling the interrupt handler
*/ */
if (irq_desc[irq].status & IRQ_LEVEL) if (irq_to_desc(d->irq)->status & IRQ_LEVEL)
out_be32(INTC_BASE + IAR, mask); out_be32(INTC_BASE + IAR, mask);
} }
static void intc_disable_or_mask(unsigned int irq) static void intc_disable_or_mask(struct irq_data *d)
{ {
pr_debug("disable: %d\n", irq); pr_debug("disable: %d\n", d->irq);
out_be32(INTC_BASE + CIE, 1 << irq); out_be32(INTC_BASE + CIE, 1 << d->irq);
} }
static void intc_ack(unsigned int irq) static void intc_ack(struct irq_data *d)
{ {
pr_debug("ack: %d\n", irq); pr_debug("ack: %d\n", d->irq);
out_be32(INTC_BASE + IAR, 1 << irq); out_be32(INTC_BASE + IAR, 1 << d->irq);
} }
static void intc_mask_ack(unsigned int irq) static void intc_mask_ack(struct irq_data *d)
{ {
unsigned long mask = 1 << irq; unsigned long mask = 1 << d->irq;
pr_debug("disable_and_ack: %d\n", irq); pr_debug("disable_and_ack: %d\n", d->irq);
out_be32(INTC_BASE + CIE, mask); out_be32(INTC_BASE + CIE, mask);
out_be32(INTC_BASE + IAR, mask); out_be32(INTC_BASE + IAR, mask);
} }
static struct irq_chip intc_dev = { static struct irq_chip intc_dev = {
.name = "Xilinx INTC", .name = "Xilinx INTC",
.unmask = intc_enable_or_unmask, .irq_unmask = intc_enable_or_unmask,
.mask = intc_disable_or_mask, .irq_mask = intc_disable_or_mask,
.ack = intc_ack, .irq_ack = intc_ack,
.mask_ack = intc_mask_ack, .irq_mask_ack = intc_mask_ack,
}; };
unsigned int get_irq(struct pt_regs *regs) unsigned int get_irq(struct pt_regs *regs)
...@@ -159,11 +159,11 @@ void __init init_IRQ(void) ...@@ -159,11 +159,11 @@ void __init init_IRQ(void)
if (intr_type & (0x00000001 << i)) { if (intr_type & (0x00000001 << i)) {
set_irq_chip_and_handler_name(i, &intc_dev, set_irq_chip_and_handler_name(i, &intc_dev,
handle_edge_irq, intc_dev.name); handle_edge_irq, intc_dev.name);
irq_desc[i].status &= ~IRQ_LEVEL; irq_clear_status_flags(i, IRQ_LEVEL);
} else { } else {
set_irq_chip_and_handler_name(i, &intc_dev, set_irq_chip_and_handler_name(i, &intc_dev,
handle_level_irq, intc_dev.name); handle_level_irq, intc_dev.name);
irq_desc[i].status |= IRQ_LEVEL; irq_set_status_flags(i, IRQ_LEVEL);
} }
} }
} }
...@@ -50,6 +50,7 @@ void __irq_entry do_IRQ(struct pt_regs *regs) ...@@ -50,6 +50,7 @@ void __irq_entry do_IRQ(struct pt_regs *regs)
int show_interrupts(struct seq_file *p, void *v) int show_interrupts(struct seq_file *p, void *v)
{ {
int i = *(loff_t *) v, j; int i = *(loff_t *) v, j;
struct irq_desc *desc;
struct irqaction *action; struct irqaction *action;
unsigned long flags; unsigned long flags;
...@@ -61,8 +62,9 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -61,8 +62,9 @@ int show_interrupts(struct seq_file *p, void *v)
} }
if (i < nr_irq) { if (i < nr_irq) {
raw_spin_lock_irqsave(&irq_desc[i].lock, flags); desc = irq_to_desc(i);
action = irq_desc[i].action; raw_spin_lock_irqsave(&desc->lock, flags);
action = desc->action;
if (!action) if (!action)
goto skip; goto skip;
seq_printf(p, "%3d: ", i); seq_printf(p, "%3d: ", i);
...@@ -72,9 +74,9 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -72,9 +74,9 @@ int show_interrupts(struct seq_file *p, void *v)
for_each_online_cpu(j) for_each_online_cpu(j)
seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
#endif #endif
seq_printf(p, " %8s", irq_desc[i].status & seq_printf(p, " %8s", desc->status &
IRQ_LEVEL ? "level" : "edge"); IRQ_LEVEL ? "level" : "edge");
seq_printf(p, " %8s", irq_desc[i].chip->name); seq_printf(p, " %8s", desc->irq_data.chip->name);
seq_printf(p, " %s", action->name); seq_printf(p, " %s", action->name);
for (action = action->next; action; action = action->next) for (action = action->next; action; action = action->next)
...@@ -82,7 +84,7 @@ int show_interrupts(struct seq_file *p, void *v) ...@@ -82,7 +84,7 @@ int show_interrupts(struct seq_file *p, void *v)
seq_putc(p, '\n'); seq_putc(p, '\n');
skip: skip:
raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); raw_spin_unlock_irqrestore(&desc->lock, flags);
} }
return 0; return 0;
} }
......
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