fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / arm26 / kernel / irq.c
index 7869d1b..d53382c 100644 (file)
@@ -18,7 +18,6 @@
  *  IRQ's are in fact implemented a bit like signal handlers for the kernel.
  *  Naturally it's not a 1:1 relation, but there are similarities.
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/ptrace.h>
 #include <linux/kernel_stat.h>
@@ -50,7 +49,7 @@ void __init arc_init_irq(void);
 #define MAX_IRQ_CNT    100000
 
 static volatile unsigned long irq_err_count;
-static spinlock_t irq_controller_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(irq_controller_lock);
 
 struct irqdesc irq_desc[NR_IRQS];
 
@@ -141,7 +140,7 @@ int show_interrupts(struct seq_file *p, void *v)
        if (i < NR_IRQS) {
                action = irq_desc[i].action;
                if (!action)
-                       continue;
+                       goto out;
                seq_printf(p, "%3d: %10u ", i, kstat_irqs(i));
                seq_printf(p, "  %s", action->name);
                for (action = action->next; action; action = action->next) {
@@ -152,6 +151,7 @@ int show_interrupts(struct seq_file *p, void *v)
                show_fiq_list(p, v);
                seq_printf(p, "Err: %10lu\n", irq_err_count);
        }
+out:
        return 0;
 }
 
@@ -187,19 +187,21 @@ static void
 __do_irq(unsigned int irq, struct irqaction *action, struct pt_regs *regs)
 {
        unsigned int status;
+       int ret;
 
        spin_unlock(&irq_controller_lock);
-       if (!(action->flags & SA_INTERRUPT))
+       if (!(action->flags & IRQF_DISABLED))
                local_irq_enable();
 
        status = 0;
        do {
-               status |= action->flags;
-               action->handler(irq, action->dev_id, regs);
+               ret = action->handler(irq, action->dev_id, regs);
+               if (ret == IRQ_HANDLED)
+                       status |= action->flags;
                action = action->next;
        } while (action);
 
-       if (status & SA_SAMPLE_RANDOM)
+       if (status & IRQF_SAMPLE_RANDOM)
                add_interrupt_randomness(irq);
 
        spin_lock_irq(&irq_controller_lock);
@@ -449,7 +451,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
         * so we have to be careful not to interfere with a
         * running system.
         */
-       if (new->flags & SA_SAMPLE_RANDOM) {
+       if (new->flags & IRQF_SAMPLE_RANDOM) {
                /*
                 * This function might sleep, we want to call it first,
                 * outside of the atomic block.
@@ -469,7 +471,7 @@ int setup_irq(unsigned int irq, struct irqaction *new)
        p = &desc->action;
        if ((old = *p) != NULL) {
                /* Can't share interrupts unless both agree to */
-               if (!(old->flags & new->flags & SA_SHIRQ)) {
+               if (!(old->flags & new->flags & IRQF_SHARED)) {
                        spin_unlock_irqrestore(&irq_controller_lock, flags);
                        return -EBUSY;
                }
@@ -524,11 +526,11 @@ int setup_irq(unsigned int irq, struct irqaction *new)
  *
  *     Flags:
  *
- *     SA_SHIRQ                Interrupt is shared
+ *     IRQF_SHARED             Interrupt is shared
  *
- *     SA_INTERRUPT            Disable local interrupts while processing
+ *     IRQF_DISABLED   Disable local interrupts while processing
  *
- *     SA_SAMPLE_RANDOM        The interrupt can be used for entropy
+ *     IRQF_SAMPLE_RANDOM      The interrupt can be used for entropy
  *
  */
 
@@ -540,10 +542,10 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
        struct irqaction *action;
 
        if (irq >= NR_IRQS || !irq_desc[irq].valid || !handler ||
-           (irq_flags & SA_SHIRQ && !dev_id))
+           (irq_flags & IRQF_SHARED && !dev_id))
                return -EINVAL;
 
-       action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
+       action = kmalloc(sizeof(struct irqaction), GFP_KERNEL);
        if (!action)
                return -ENOMEM;