[adm5120] minor cleanups
authorGabor Juhos <juhosg@openwrt.org>
Mon, 25 Aug 2008 07:28:04 +0000 (07:28 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Mon, 25 Aug 2008 07:28:04 +0000 (07:28 +0000)
SVN-Revision: 12387

17 files changed:
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.h
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/board.c
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/gpio.c
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/irq.c
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/platform.c
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/prom.c
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/setup.c
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.c
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.h
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/edimax/br-61xx.h
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/infineon/infineon.h
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/mikrotik/rb-1xx.h
target/linux/adm5120/files-2.6.26/arch/mips/adm5120/zyxel/p-33x.h
target/linux/adm5120/files-2.6.26/drivers/net/adm5120sw.c
target/linux/adm5120/files-2.6.26/drivers/watchdog/adm5120_wdt.c
target/linux/adm5120/files-2.6.26/include/asm-mips/mach-adm5120/adm5120_irq.h [deleted file]
target/linux/adm5120/files-2.6.26/include/asm-mips/mach-adm5120/irq.h [new file with mode: 0644]

index 70742e9b5956c0f054bf8f903a7b3206871be5e7..175fbb249cc96344fe20fad52d59382ce2432013 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/gpio.h>
+#include <linux/irq.h>
 #include <linux/etherdevice.h>
 
 #include <asm/bootinfo.h>
@@ -19,7 +20,6 @@
 #include <asm/mach-adm5120/adm5120_info.h>
 #include <asm/mach-adm5120/adm5120_board.h>
 #include <asm/mach-adm5120/adm5120_platform.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 
 extern void cellvision_mac_setup(void) __init;
 
index bfd4bf8befe7c738b7fc285e002093bf2ab0034d..ffca7e01c71016474d8d60698910e1e3ad22d124 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
+#include <linux/string.h>
 #include <linux/device.h>
 #include <linux/platform_device.h>
 
@@ -19,7 +20,6 @@
 
 #include <asm/mach-adm5120/adm5120_info.h>
 #include <asm/mach-adm5120/adm5120_defs.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 #include <asm/mach-adm5120/adm5120_board.h>
 #include <asm/mach-adm5120/adm5120_platform.h>
 
@@ -60,9 +60,9 @@ static int __init adm5120_board_setup(void)
                        mips_machtype);
 
        if (board->name[0])
-               memcpy(adm5120_board_name, board->name, ADM5120_BOARD_NAMELEN);
+               strlcpy(adm5120_board_name, board->name, ADM5120_BOARD_NAMELEN);
 
-       printk(KERN_INFO PFX "board is '%s'\n", board->name);
+       printk(KERN_INFO PFX "board is '%s'\n", adm5120_board_name);
 
        adm5120_gpio_init();
 
index bce3dddf983588c9a641008d243977a65b13b4df..aed0038752c8a6d667de48e58a1f3d8d0a447069 100644 (file)
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/module.h>
+#include <linux/irq.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/gpio.h>
 
 #include <asm/addrspace.h>
-#include <linux/gpio.h>
 
 #include <asm/mach-adm5120/adm5120_defs.h>
 #include <asm/mach-adm5120/adm5120_info.h>
 #include <asm/mach-adm5120/adm5120_switch.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 
 #define GPIO_READ(r)           __raw_readl((r))
 #define GPIO_WRITE(v, r)       __raw_writel((v), (r))
index ce303ec74a7b89dc7546c40d88341a10bce884dd..140a7a0e954b0336459a9a2201b1b100a8b2a916 100644 (file)
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/version.h>
+#include <linux/irq.h>
 #include <linux/interrupt.h>
 #include <linux/ioport.h>
 #include <linux/io.h>
 
-#include <asm/irq.h>
 #include <asm/irq_cpu.h>
 #include <asm/mipsregs.h>
 #include <asm/bitops.h>
 
 #include <asm/mach-adm5120/adm5120_defs.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 
 static void adm5120_intc_irq_unmask(unsigned int irq);
 static void adm5120_intc_irq_mask(unsigned int irq);
@@ -121,9 +120,7 @@ static void adm5120_intc_irq_dispatch(void)
        unsigned long status;
        int irq;
 
-       /* dispatch only one IRQ at a time */
        status = intc_read_reg(INTC_REG_IRQ_STATUS) & INTC_INT_ALL;
-
        if (status) {
                irq = ADM5120_INTC_IRQ_BASE + fls(status) - 1;
                do_IRQ(irq);
index 5cae2023fd15dc246ced6cef12f4824df40d72cd..9526fe977f690ac21921052c6c6e839223a7ba34 100644 (file)
 #include <linux/dma-mapping.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/irq.h>
 
 #include <asm/bootinfo.h>
 
 #include <asm/mach-adm5120/adm5120_defs.h>
 #include <asm/mach-adm5120/adm5120_info.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 #include <asm/mach-adm5120/adm5120_switch.h>
 #include <asm/mach-adm5120/adm5120_nand.h>
 #include <asm/mach-adm5120/adm5120_platform.h>
index af2bfb5a53db71ce938b75472e19b8e84141e1d3..260c4e5bbf9d078cf313da732a82809582d13fc2 100644 (file)
@@ -241,9 +241,7 @@ static void __init prom_init_cmdline(void)
        /* init command line, register a default kernel command line */
        cmd = &_image_cmdline + 8;
        if (strlen(cmd) > 0)
-               strcpy(arcs_cmdline, cmd);
-       else
-               strcpy(arcs_cmdline, CONFIG_CMDLINE);
+               strlcpy(arcs_cmdline, cmd, sizeof(arcs_cmdline));
 
 }
 
@@ -262,7 +260,6 @@ void __init prom_putchar(char ch)
 void __init prom_init(void)
 {
        prom_detect_machtype();
-
        prom_init_cmdline();
 }
 
index 3a31917a2b8a632d31a0d78ea54f5d92c3efb06e..0a117746242e6669e33cb0397a7a4e9335214e6a 100644 (file)
@@ -69,7 +69,7 @@ static void adm5120_halt(void)
        while (1) {
                if (cpu_wait)
                        cpu_wait();
-       };
+       }
 }
 
 void __init plat_time_init(void)
index 81157812bbbe6875781a7b66693fac5324688d89..d100bf0343cea00908040f44d8c49b700652a24a 100644 (file)
@@ -34,8 +34,8 @@ void __init compex_mac_setup(void)
 
                for (i = 0; i < 6; i++) {
                        if (is_valid_ether_addr(myloader_info.macs[i]))
-                               memcpy(myloader_info.macs[i],
-                                               adm5120_eth_macs[i], ETH_ALEN);
+                               memcpy(adm5120_eth_macs[i],
+                                       myloader_info.macs[i], ETH_ALEN);
                        else
                                random_ether_addr(adm5120_eth_macs[i]);
                }
index 739a90d02347e8ba9f0a97d58711a4a41abe3cb4..62425374add68d5119079632a2be135f127adba2 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/gpio.h>
+#include <linux/irq.h>
 #include <linux/etherdevice.h>
 
 #include <asm/bootinfo.h>
@@ -19,6 +20,5 @@
 #include <asm/mach-adm5120/adm5120_info.h>
 #include <asm/mach-adm5120/adm5120_board.h>
 #include <asm/mach-adm5120/adm5120_platform.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 
 extern void compex_generic_setup(void) __init;
index d7efda32d1140dde5002f0b0b6f4a905de1c3aa5..f8ad137a49382e613c27edf5c504c0a4be8ff86d 100644 (file)
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/gpio.h>
+#include <linux/irq.h>
 #include <linux/etherdevice.h>
 
 #include <asm/bootinfo.h>
 
 #include <asm/mach-adm5120/adm5120_board.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 #include <asm/mach-adm5120/adm5120_platform.h>
 
 extern void __init br61xx_generic_setup(void) __init;
index f3b28e08806e05b0201d1605bfa63d76b67ef5e9..2e25a8f3de2ccfc126ca916962662e09bd8d264e 100644 (file)
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/gpio.h>
+#include <linux/irq.h>
 #include <linux/etherdevice.h>
 
 #include <asm/bootinfo.h>
 
 #include <asm/mach-adm5120/adm5120_defs.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 #include <asm/mach-adm5120/adm5120_board.h>
 #include <asm/mach-adm5120/adm5120_platform.h>
 #include <asm/mach-adm5120/adm5120_info.h>
index d5acef028e782629266762c9ba0b13fd24c0a8e3..1577ed66d0b706070b8bd956f77dc24591e31fc7 100644 (file)
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
+#include <linux/irq.h>
 #include <linux/etherdevice.h>
 
 #include <asm/bootinfo.h>
 
 #include <asm/mach-adm5120/adm5120_defs.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 #include <asm/mach-adm5120/adm5120_nand.h>
 #include <asm/mach-adm5120/adm5120_board.h>
 #include <asm/mach-adm5120/adm5120_platform.h>
index 4817e810507fcc386d4680f0c25687e7988c7952..0971cd5d265ad1d2801c133c75b6a3f0162d3d6e 100644 (file)
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/gpio.h>
+#include <linux/irq.h>
 
 #include <asm/bootinfo.h>
 
 #include <asm/mach-adm5120/adm5120_board.h>
 #include <asm/mach-adm5120/adm5120_platform.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 
 extern void p33x_generic_setup(void) __init;
index ff95ac009f4d7eaa59e0752763b7971e978ff8bf..7acc84d248b9ba0622df1c6ab08d2465b3260637 100644 (file)
 #include <linux/ioport.h>
 #include <linux/spinlock.h>
 #include <linux/platform_device.h>
+#include <linux/io.h>
+#include <linux/irq.h>
 
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 
-#include <linux/io.h>
-#include <linux/irq.h>
-
 #include <asm/mipsregs.h>
 
 #include <asm/mach-adm5120/adm5120_info.h>
 #include <asm/mach-adm5120/adm5120_defs.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 #include <asm/mach-adm5120/adm5120_switch.h>
 
 #include "adm5120sw.h"
index 125a41f1379708f4e5396c10926b22566a9e6f19..e92a8984312539b49cdb72724288dfbd400b2ad2 100644 (file)
  *     2 of the License, or (at your option) any later version.
  *
  */
-
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/watchdog.h>
+#include <linux/irq.h>
 
 #include <asm/bootinfo.h>
 
 #include <asm/mach-adm5120/adm5120_info.h>
 #include <asm/mach-adm5120/adm5120_defs.h>
-#include <asm/mach-adm5120/adm5120_irq.h>
 #include <asm/mach-adm5120/adm5120_switch.h>
 
-
 #define DEFAULT_TIMEOUT        15              /* (secs) Default is 15 seconds */
 #define MAX_TIMEOUT    327
 /* Max is 327 seconds, counter is 15-bit integer, step is 10 ms */
diff --git a/target/linux/adm5120/files-2.6.26/include/asm-mips/mach-adm5120/adm5120_irq.h b/target/linux/adm5120/files-2.6.26/include/asm-mips/mach-adm5120/adm5120_irq.h
deleted file mode 100644 (file)
index d0dfb6e..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *  ADM5120 specific IRQ numbers
- *
- *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
- *
- *  This program is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License version 2 as published
- *  by the Free Software Foundation.
- *
- */
-#ifndef _MACH_ADM5120_IRQ_H
-#define _MACH_ADM5120_IRQ_H
-
-#include <asm/mach-adm5120/adm5120_intc.h>
-
-#define MIPS_IRQ_HW0           2
-#define MIPS_IRQ_COUNTER       7
-#define MIPS_IRQ_COUNT         8
-
-#define ADM5120_CPU_IRQ_BASE   0
-#define ADM5120_INTC_IRQ_BASE  (ADM5120_CPU_IRQ_BASE + MIPS_IRQ_COUNT)
-#define ADM5120_SWITCH_IRQ_BASE (ADM5120_INTC_IRQ_BASE + INTC_IRQ_COUNT)
-
-#define ADM5120_CPU_IRQ(x)     (ADM5120_CPU_IRQ_BASE + (x))
-#define ADM5120_INTC_IRQ(x)    (ADM5120_INTC_IRQ_BASE + (x))
-
-#define ADM5120_IRQ_INTC       ADM5120_CPU_IRQ(MIPS_IRQ_HW0)
-#define ADM5120_IRQ_COUNTER    ADM5120_CPU_IRQ(MIPS_IRQ_COUNTER)
-
-#define ADM5120_IRQ_TIMER      ADM5120_INTC_IRQ(INTC_IRQ_TIMER)
-#define ADM5120_IRQ_UART0      ADM5120_INTC_IRQ(INTC_IRQ_UART0)
-#define ADM5120_IRQ_UART1      ADM5120_INTC_IRQ(INTC_IRQ_UART1)
-#define ADM5120_IRQ_USBC       ADM5120_INTC_IRQ(INTC_IRQ_USBC)
-#define ADM5120_IRQ_GPIO2      ADM5120_INTC_IRQ(INTC_IRQ_GPIO2)
-#define ADM5120_IRQ_GPIO4      ADM5120_INTC_IRQ(INTC_IRQ_GPIO4)
-#define ADM5120_IRQ_PCI0       ADM5120_INTC_IRQ(INTC_IRQ_PCI0)
-#define ADM5120_IRQ_PCI1       ADM5120_INTC_IRQ(INTC_IRQ_PCI1)
-#define ADM5120_IRQ_PCI2       ADM5120_INTC_IRQ(INTC_IRQ_PCI2)
-#define ADM5120_IRQ_SWITCH     ADM5120_INTC_IRQ(INTC_IRQ_SWITCH)
-
-#endif /* _MACH_ADM5120_IRQ_H */
diff --git a/target/linux/adm5120/files-2.6.26/include/asm-mips/mach-adm5120/irq.h b/target/linux/adm5120/files-2.6.26/include/asm-mips/mach-adm5120/irq.h
new file mode 100644 (file)
index 0000000..b0350c8
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ *  ADM5120 specific IRQ numbers
+ *
+ *  Copyright (C) 2007-2008 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ *
+ */
+#ifndef _ASM_MIPS_MACH_ADM5120_IRQ_H
+#define _ASM_MIPS_MACH_ADM5120_IRQ_H
+
+#define MIPS_CPU_IRQ_BASE      0
+#define NR_IRQS                        24
+
+#include_next <irq.h>
+
+#include <asm/mach-adm5120/adm5120_intc.h>
+
+#define NO_IRQ                 (-1)
+
+#define MIPS_CPU_IRQ_COUNT     8
+#define MIPS_CPU_IRQ(x)                (MIPS_CPU_IRQ_BASE + (x))
+
+#define ADM5120_INTC_IRQ_BASE  (MIPS_CPU_IRQ_BASE + MIPS_CPU_IRQ_COUNT)
+#define ADM5120_INTC_IRQ(x)    (ADM5120_INTC_IRQ_BASE + (x))
+
+#define ADM5120_IRQ_INTC       MIPS_CPU_IRQ(2)
+#define ADM5120_IRQ_COUNTER    MIPS_CPU_IRQ(7)
+
+#define ADM5120_IRQ_TIMER      ADM5120_INTC_IRQ(INTC_IRQ_TIMER)
+#define ADM5120_IRQ_UART0      ADM5120_INTC_IRQ(INTC_IRQ_UART0)
+#define ADM5120_IRQ_UART1      ADM5120_INTC_IRQ(INTC_IRQ_UART1)
+#define ADM5120_IRQ_USBC       ADM5120_INTC_IRQ(INTC_IRQ_USBC)
+#define ADM5120_IRQ_GPIO2      ADM5120_INTC_IRQ(INTC_IRQ_GPIO2)
+#define ADM5120_IRQ_GPIO4      ADM5120_INTC_IRQ(INTC_IRQ_GPIO4)
+#define ADM5120_IRQ_PCI0       ADM5120_INTC_IRQ(INTC_IRQ_PCI0)
+#define ADM5120_IRQ_PCI1       ADM5120_INTC_IRQ(INTC_IRQ_PCI1)
+#define ADM5120_IRQ_PCI2       ADM5120_INTC_IRQ(INTC_IRQ_PCI2)
+#define ADM5120_IRQ_SWITCH     ADM5120_INTC_IRQ(INTC_IRQ_SWITCH)
+
+#endif /* _ASM_MIPS_MACH_ADM5120_IRQ_H */