vserver 1.9.5.x5
[linux-2.6.git] / arch / mips / tx4927 / common / tx4927_irq.c
index bf59409..5ab2e2b 100644 (file)
@@ -37,7 +37,7 @@
 #include <linux/slab.h>
 #include <linux/random.h>
 #include <linux/irq.h>
-#include <asm/bitops.h>
+#include <linux/bitops.h>
 #include <asm/bootinfo.h>
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -48,8 +48,6 @@
 /*
  * DEBUG
  */
-#define TX4927_IRQ_CHECK_CP0
-#define TX4927_IRQ_CHECK_PIC
 
 #undef TX4927_IRQ_DEBUG
 
@@ -145,8 +143,8 @@ static void tx4927_irq_pic_end(unsigned int irq);
  * Kernel structs for all pic's
  */
 
-static spinlock_t tx4927_cp0_lock = SPIN_LOCK_UNLOCKED;
-static spinlock_t tx4927_pic_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(tx4927_cp0_lock);
+static DEFINE_SPINLOCK(tx4927_pic_lock);
 
 #define TX4927_CP0_NAME "TX4927-CP0"
 static struct hw_interrupt_type tx4927_irq_cp0_type = {
@@ -239,16 +237,6 @@ static unsigned int tx4927_irq_cp0_startup(unsigned int irq)
 {
        TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_STARTUP, "irq=%d \n", irq);
 
-#ifdef TX4927_IRQ_CHECK_CP0
-       {
-               if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        tx4927_irq_cp0_enable(irq);
 
        return (0);
@@ -258,16 +246,6 @@ static void tx4927_irq_cp0_shutdown(unsigned int irq)
 {
        TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_SHUTDOWN, "irq=%d \n", irq);
 
-#ifdef TX4927_IRQ_CHECK_CP0
-       {
-               if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        tx4927_irq_cp0_disable(irq);
 
        return;
@@ -279,16 +257,6 @@ static void tx4927_irq_cp0_enable(unsigned int irq)
 
        TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_ENABLE, "irq=%d \n", irq);
 
-#ifdef TX4927_IRQ_CHECK_CP0
-       {
-               if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        spin_lock_irqsave(&tx4927_cp0_lock, flags);
 
        tx4927_irq_cp0_modify(CCP0_STATUS, 0, tx4927_irq_cp0_mask(irq));
@@ -304,16 +272,6 @@ static void tx4927_irq_cp0_disable(unsigned int irq)
 
        TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_DISABLE, "irq=%d \n", irq);
 
-#ifdef TX4927_IRQ_CHECK_CP0
-       {
-               if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        spin_lock_irqsave(&tx4927_cp0_lock, flags);
 
        tx4927_irq_cp0_modify(CCP0_STATUS, tx4927_irq_cp0_mask(irq), 0);
@@ -327,16 +285,6 @@ static void tx4927_irq_cp0_mask_and_ack(unsigned int irq)
 {
        TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_MASK, "irq=%d \n", irq);
 
-#ifdef TX4927_IRQ_CHECK_CP0
-       {
-               if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        tx4927_irq_cp0_disable(irq);
 
        return;
@@ -346,16 +294,6 @@ static void tx4927_irq_cp0_end(unsigned int irq)
 {
        TX4927_IRQ_DPRINTK(TX4927_IRQ_CP0_ENDIRQ, "irq=%d \n", irq);
 
-#ifdef TX4927_IRQ_CHECK_CP0
-       {
-               if (irq < TX4927_IRQ_CP0_BEG || irq > TX4927_IRQ_CP0_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
                tx4927_irq_cp0_enable(irq);
        }
@@ -516,16 +454,6 @@ static unsigned int tx4927_irq_pic_startup(unsigned int irq)
 {
        TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_STARTUP, "irq=%d\n", irq);
 
-#ifdef TX4927_IRQ_CHECK_PIC
-       {
-               if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        tx4927_irq_pic_enable(irq);
 
        return (0);
@@ -535,16 +463,6 @@ static void tx4927_irq_pic_shutdown(unsigned int irq)
 {
        TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_SHUTDOWN, "irq=%d\n", irq);
 
-#ifdef TX4927_IRQ_CHECK_PIC
-       {
-               if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        tx4927_irq_pic_disable(irq);
 
        return;
@@ -556,16 +474,6 @@ static void tx4927_irq_pic_enable(unsigned int irq)
 
        TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENABLE, "irq=%d\n", irq);
 
-#ifdef TX4927_IRQ_CHECK_PIC
-       {
-               if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        spin_lock_irqsave(&tx4927_pic_lock, flags);
 
        tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq), 0,
@@ -582,16 +490,6 @@ static void tx4927_irq_pic_disable(unsigned int irq)
 
        TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_DISABLE, "irq=%d\n", irq);
 
-#ifdef TX4927_IRQ_CHECK_PIC
-       {
-               if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        spin_lock_irqsave(&tx4927_pic_lock, flags);
 
        tx4927_irq_pic_modify(tx4927_irq_pic_addr(irq),
@@ -606,16 +504,6 @@ static void tx4927_irq_pic_mask_and_ack(unsigned int irq)
 {
        TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_MASK, "irq=%d\n", irq);
 
-#ifdef TX4927_IRQ_CHECK_PIC
-       {
-               if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        tx4927_irq_pic_disable(irq);
 
        return;
@@ -625,16 +513,6 @@ static void tx4927_irq_pic_end(unsigned int irq)
 {
        TX4927_IRQ_DPRINTK(TX4927_IRQ_PIC_ENDIRQ, "irq=%d\n", irq);
 
-#ifdef TX4927_IRQ_CHECK_PIC
-       {
-               if (irq < TX4927_IRQ_PIC_BEG || irq > TX4927_IRQ_PIC_END) {
-                       TX4927_IRQ_DPRINTK(TX4927_IRQ_EROR,
-                                          "bad irq=%d \n", irq);
-                       panic("\n");
-               }
-       }
-#endif
-
        if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) {
                tx4927_irq_pic_enable(irq);
        }