Merge branch 'submit1' of viper:/spare/repo/irq-remove-2.6 into irqcleanups
[powerpc.git] / kernel / irq / chip.c
index 0dc2438..11c9969 100644 (file)
@@ -67,6 +67,13 @@ void dynamic_irq_cleanup(unsigned int irq)
 
        desc = irq_desc + irq;
        spin_lock_irqsave(&desc->lock, flags);
+       if (desc->action) {
+               spin_unlock_irqrestore(&desc->lock, flags);
+               printk(KERN_ERR "Destroying IRQ%d without calling free_irq\n",
+                       irq);
+               WARN_ON(1);
+               return;
+       }
        desc->handle_irq = handle_bad_irq;
        desc->chip = &no_irq_chip;
        spin_unlock_irqrestore(&desc->lock, flags);
@@ -242,7 +249,6 @@ static inline void mask_ack_irq(struct irq_desc *desc, int irq)
  *     handle_simple_irq - Simple and software-decoded IRQs.
  *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
- *     @regs:  pointer to a register structure
  *
  *     Simple interrupts are either sent from a demultiplexing interrupt
  *     handler or come from hardware, where no interrupt hardware control
@@ -252,7 +258,7 @@ static inline void mask_ack_irq(struct irq_desc *desc, int irq)
  *     unmask issues if necessary.
  */
 void fastcall
-handle_simple_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
+handle_simple_irq(unsigned int irq, struct irq_desc *desc)
 {
        struct irqaction *action;
        irqreturn_t action_ret;
@@ -272,9 +278,9 @@ handle_simple_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
        desc->status |= IRQ_INPROGRESS;
        spin_unlock(&desc->lock);
 
-       action_ret = handle_IRQ_event(irq, regs, action);
+       action_ret = handle_IRQ_event(irq, action);
        if (!noirqdebug)
-               note_interrupt(irq, desc, action_ret, regs);
+               note_interrupt(irq, desc, action_ret);
 
        spin_lock(&desc->lock);
        desc->status &= ~IRQ_INPROGRESS;
@@ -286,7 +292,6 @@ out_unlock:
  *     handle_level_irq - Level type irq handler
  *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
- *     @regs:  pointer to a register structure
  *
  *     Level type interrupts are active as long as the hardware line has
  *     the active level. This may require to mask the interrupt and unmask
@@ -294,7 +299,7 @@ out_unlock:
  *     interrupt line is back to inactive.
  */
 void fastcall
-handle_level_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
+handle_level_irq(unsigned int irq, struct irq_desc *desc)
 {
        unsigned int cpu = smp_processor_id();
        struct irqaction *action;
@@ -322,9 +327,9 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
        desc->status &= ~IRQ_PENDING;
        spin_unlock(&desc->lock);
 
-       action_ret = handle_IRQ_event(irq, regs, action);
+       action_ret = handle_IRQ_event(irq, action);
        if (!noirqdebug)
-               note_interrupt(irq, desc, action_ret, regs);
+               note_interrupt(irq, desc, action_ret);
 
        spin_lock(&desc->lock);
        desc->status &= ~IRQ_INPROGRESS;
@@ -338,7 +343,6 @@ out_unlock:
  *     handle_fasteoi_irq - irq handler for transparent controllers
  *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
- *     @regs:  pointer to a register structure
  *
  *     Only a single callback will be issued to the chip: an ->eoi()
  *     call when the interrupt has been serviced. This enables support
@@ -346,8 +350,7 @@ out_unlock:
  *     details in hardware, transparently.
  */
 void fastcall
-handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc,
-                  struct pt_regs *regs)
+handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
 {
        unsigned int cpu = smp_processor_id();
        struct irqaction *action;
@@ -375,9 +378,9 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc,
        desc->status &= ~IRQ_PENDING;
        spin_unlock(&desc->lock);
 
-       action_ret = handle_IRQ_event(irq, regs, action);
+       action_ret = handle_IRQ_event(irq, action);
        if (!noirqdebug)
-               note_interrupt(irq, desc, action_ret, regs);
+               note_interrupt(irq, desc, action_ret);
 
        spin_lock(&desc->lock);
        desc->status &= ~IRQ_INPROGRESS;
@@ -391,7 +394,6 @@ out:
  *     handle_edge_irq - edge type IRQ handler
  *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
- *     @regs:  pointer to a register structure
  *
  *     Interrupt occures on the falling and/or rising edge of a hardware
  *     signal. The occurence is latched into the irq controller hardware
@@ -405,7 +407,7 @@ out:
  *     loop is left.
  */
 void fastcall
-handle_edge_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
+handle_edge_irq(unsigned int irq, struct irq_desc *desc)
 {
        const unsigned int cpu = smp_processor_id();
 
@@ -456,9 +458,9 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
 
                desc->status &= ~IRQ_PENDING;
                spin_unlock(&desc->lock);
-               action_ret = handle_IRQ_event(irq, regs, action);
+               action_ret = handle_IRQ_event(irq, action);
                if (!noirqdebug)
-                       note_interrupt(irq, desc, action_ret, regs);
+                       note_interrupt(irq, desc, action_ret);
                spin_lock(&desc->lock);
 
        } while ((desc->status & (IRQ_PENDING | IRQ_DISABLED)) == IRQ_PENDING);
@@ -473,12 +475,11 @@ out_unlock:
  *     handle_percpu_IRQ - Per CPU local irq handler
  *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
- *     @regs:  pointer to a register structure
  *
  *     Per CPU interrupts on SMP machines without locking requirements
  */
 void fastcall
-handle_percpu_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
+handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
 {
        irqreturn_t action_ret;
 
@@ -487,9 +488,9 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
        if (desc->chip->ack)
                desc->chip->ack(irq);
 
-       action_ret = handle_IRQ_event(irq, regs, desc->action);
+       action_ret = handle_IRQ_event(irq, desc->action);
        if (!noirqdebug)
-               note_interrupt(irq, desc, action_ret, regs);
+               note_interrupt(irq, desc, action_ret);
 
        if (desc->chip->eoi)
                desc->chip->eoi(irq);
@@ -498,10 +499,7 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
 #endif /* CONFIG_SMP */
 
 void
-__set_irq_handler(unsigned int irq,
-                 void fastcall (*handle)(unsigned int, irq_desc_t *,
-                                         struct pt_regs *),
-                 int is_chained)
+__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained)
 {
        struct irq_desc *desc;
        unsigned long flags;
@@ -554,9 +552,7 @@ __set_irq_handler(unsigned int irq,
 
 void
 set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
-                        void fastcall (*handle)(unsigned int,
-                                                struct irq_desc *,
-                                                struct pt_regs *))
+                        irq_flow_handler_t handle)
 {
        set_irq_chip(irq, chip);
        __set_irq_handler(irq, handle, 0);
@@ -567,8 +563,7 @@ set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
  * /proc/interrupts output:
  */
 const char *
-handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *,
-                                       struct pt_regs *))
+handle_irq_name(irq_flow_handler_t handle)
 {
        if (handle == handle_level_irq)
                return "level  ";