@@ -8,10 +8,6 @@
#ifndef __ASM_HW_IRQ_H
#define __ASM_HW_IRQ_H
-#include <linux/atomic.h>
-
-extern atomic_t irq_err_count;
-
/*
* interrupt-retrigger: NOP for now. This may not be appropriate for all
* machines, we'll see ...
@@ -11,6 +11,7 @@
#include <linux/types.h>
#include <asm/gt64120.h>
+#include <asm-generic/irq-err.h>
#define GT641XX_IRQ_TO_BIT(irq) (1U << (irq - GT641XX_IRQ_BASE))
@@ -97,7 +98,7 @@ void gt641xx_irq_dispatch(void)
}
}
- atomic_inc(&irq_err_count);
+ irq_err_inc();
}
void __init gt641xx_irq_init(void)
@@ -8,6 +8,7 @@
* Copyright (C) 1992 Linus Torvalds
* Copyright (C) 1994 - 2000 Ralf Baechle
*/
+#include <asm-generic/irq-err.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/init.h>
@@ -27,17 +28,15 @@
void *irq_stack[NR_CPUS];
-atomic_t irq_err_count;
-
int arch_show_interrupts(struct seq_file *p, int prec)
{
- seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count));
+ seq_printf(p, "%*s: %10u\n", prec, "ERR", irq_err_get());
return 0;
}
asmlinkage void spurious_interrupt(void)
{
- atomic_inc(&irq_err_count);
+ irq_err_inc();
}
void __init init_IRQ(void)
@@ -21,6 +21,7 @@
#include <asm/sni.h>
#include <asm/time.h>
#include <asm/irq_cpu.h>
+#include <asm-generic/irq-err.h>
#define RM200_I8259A_IRQ_BASE 32
@@ -270,7 +271,7 @@ void sni_rm200_mask_and_ack_8259A(struct irq_data *d)
"spurious RM200 8259A interrupt: IRQ%d.\n", irq);
spurious_irq_mask |= irqmask;
}
- atomic_inc(&irq_err_count);
+ irq_err_inc();
/*
* Theoretically we do not have to handle this IRQ,
* but in Linux this does not cause problems and is
@@ -27,6 +27,7 @@
#include <asm/io.h>
#include <asm/vr41xx/irq.h>
#include <asm/vr41xx/vr41xx.h>
+#include <asm-generic/irq-err.h>
static void __iomem *icu1_base;
static void __iomem *icu2_base;
@@ -640,7 +641,7 @@ static int icu_get_irq(unsigned int irq)
printk(KERN_ERR "spurious ICU interrupt: %04x,%04x\n", pend1, pend2);
- atomic_inc(&irq_err_count);
+ irq_err_inc();
return -1;
}
@@ -10,6 +10,7 @@
#include <asm/irq_cpu.h>
#include <asm/vr41xx/irq.h>
+#include <asm-generic/irq-err.h>
typedef struct irq_cascade {
int (*get_irq)(unsigned int);
@@ -46,7 +47,7 @@ static void irq_dispatch(unsigned int irq)
irq_cascade_t *cascade;
if (irq >= NR_IRQS) {
- atomic_inc(&irq_err_count);
+ irq_err_inc();
return;
}
@@ -66,7 +67,7 @@ static void irq_dispatch(unsigned int irq)
ret = cascade->get_irq(irq);
irq = ret;
if (ret < 0)
- atomic_inc(&irq_err_count);
+ irq_err_inc();
else
irq_dispatch(irq);
if (!irqd_irq_disabled(idata) && chip->irq_unmask)
@@ -18,7 +18,7 @@
#include <linux/platform_device.h>
#include <linux/spinlock.h>
#include <linux/types.h>
-
+#include <asm-generic/irq-err.h>
#include <asm/vr41xx/giu.h>
#include <asm/vr41xx/irq.h>
#include <asm/vr41xx/vr41xx.h>
@@ -217,7 +217,7 @@ static int giu_get_irq(unsigned int irq)
printk(KERN_ERR "spurious GIU interrupt: %04x(%04x),%04x(%04x)\n",
maskl, pendl, maskh, pendh);
- atomic_inc(&irq_err_count);
+ irq_err_inc();
return -EINVAL;
}
Use the newly introduced irq error counter, that's already maintained by all callers of ack_bad_irq(), in order to remove duplicate code. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> --- arch/mips/include/asm/hw_irq.h | 4 ---- arch/mips/kernel/irq-gt641xx.c | 3 ++- arch/mips/kernel/irq.c | 7 +++---- arch/mips/sni/rm200.c | 3 ++- arch/mips/vr41xx/common/icu.c | 3 ++- arch/mips/vr41xx/common/irq.c | 5 +++-- drivers/gpio/gpio-vr41xx.c | 4 ++-- 7 files changed, 14 insertions(+), 15 deletions(-)