tunnels: fix netns vs proto registration ordering
[safe/jmp/linux-2.6] / arch / arm / mach-sa1100 / neponset.c
index 075d4d1..6ccd175 100644 (file)
@@ -4,21 +4,20 @@
  */
 #include <linux/kernel.h>
 #include <linux/init.h>
-#include <linux/ptrace.h>
 #include <linux/tty.h>
 #include <linux/ioport.h>
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 
-#include <asm/hardware.h>
+#include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <asm/irq.h>
 #include <asm/mach/map.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/serial_sa1100.h>
-#include <asm/arch/assabet.h>
-#include <asm/arch/neponset.h>
+#include <mach/assabet.h>
+#include <mach/neponset.h>
 #include <asm/hardware/sa1111.h>
 #include <asm/sizes.h>
 
@@ -34,8 +33,6 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
        unsigned int irr;
 
        while (1) {
-               struct irq_desc *d;
-
                /*
                 * Acknowledge the parent IRQ.
                 */
@@ -68,21 +65,18 @@ neponset_irq_handler(unsigned int irq, struct irq_desc *desc)
                        desc->chip->ack(irq);
 
                        if (irr & IRR_ETHERNET) {
-                               d = irq_desc + IRQ_NEPONSET_SMC9196;
-                               desc_handle_irq(IRQ_NEPONSET_SMC9196, d);
+                               generic_handle_irq(IRQ_NEPONSET_SMC9196);
                        }
 
                        if (irr & IRR_USAR) {
-                               d = irq_desc + IRQ_NEPONSET_USAR;
-                               desc_handle_irq(IRQ_NEPONSET_USAR, d);
+                               generic_handle_irq(IRQ_NEPONSET_USAR);
                        }
 
                        desc->chip->unmask(irq);
                }
 
                if (irr & IRR_SA1111) {
-                       d = irq_desc + IRQ_NEPONSET_SA1111;
-                       desc_handle_irq(IRQ_NEPONSET_SA1111, d);
+                       generic_handle_irq(IRQ_NEPONSET_SA1111);
                }
        }
 }
@@ -140,19 +134,19 @@ static u_int neponset_get_mctrl(struct uart_port *port)
        return ret;
 }
 
-static struct sa1100_port_fns neponset_port_fns __initdata = {
+static struct sa1100_port_fns neponset_port_fns __devinitdata = {
        .set_mctrl      = neponset_set_mctrl,
        .get_mctrl      = neponset_get_mctrl,
 };
 
-static int neponset_probe(struct platform_device *dev)
+static int __devinit neponset_probe(struct platform_device *dev)
 {
        sa1100_register_uart_fns(&neponset_port_fns);
 
        /*
         * Install handler for GPIO25.
         */
-       set_irq_type(IRQ_GPIO25, IRQT_RISING);
+       set_irq_type(IRQ_GPIO25, IRQ_TYPE_EDGE_RISING);
        set_irq_chained_handler(IRQ_GPIO25, neponset_irq_handler);
 
        /*
@@ -186,28 +180,21 @@ static int neponset_probe(struct platform_device *dev)
 /*
  * LDM power management.
  */
+static unsigned int neponset_saved_state;
+
 static int neponset_suspend(struct platform_device *dev, pm_message_t state)
 {
        /*
         * Save state.
         */
-       if (!dev->dev.power.saved_state)
-               dev->dev.power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
-       if (!dev->dev.power.saved_state)
-               return -ENOMEM;
-
-       *(unsigned int *)dev->dev.power.saved_state = NCR_0;
+       neponset_saved_state = NCR_0;
 
        return 0;
 }
 
 static int neponset_resume(struct platform_device *dev)
 {
-       if (dev->dev.power.saved_state) {
-               NCR_0 = *(unsigned int *)dev->dev.power.saved_state;
-               kfree(dev->dev.power.saved_state);
-               dev->dev.power.saved_state = NULL;
-       }
+       NCR_0 = neponset_saved_state;
 
        return 0;
 }
@@ -300,6 +287,8 @@ static struct platform_device *devices[] __initdata = {
        &smc91x_device,
 };
 
+extern void sa1110_mb_disable(void);
+
 static int __init neponset_init(void)
 {
        platform_driver_register(&neponset_device_driver);