From 19afa52270f83cc373ae4ecdef92c74dcb01f38c Mon Sep 17 00:00:00 2001 From: juhosg Date: Mon, 25 Aug 2008 07:28:04 +0000 Subject: [PATCH] [adm5120] minor cleanups git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12387 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../arch/mips/adm5120/cellvision/cellvision.h | 2 +- .../arch/mips/adm5120/common/board.c | 6 ++--- .../arch/mips/adm5120/common/gpio.c | 4 +-- .../arch/mips/adm5120/common/irq.c | 5 +--- .../arch/mips/adm5120/common/platform.c | 2 +- .../arch/mips/adm5120/common/prom.c | 5 +--- .../arch/mips/adm5120/common/setup.c | 2 +- .../arch/mips/adm5120/compex/compex.c | 4 +-- .../arch/mips/adm5120/compex/compex.h | 2 +- .../arch/mips/adm5120/edimax/br-61xx.h | 2 +- .../arch/mips/adm5120/infineon/infineon.h | 2 +- .../arch/mips/adm5120/mikrotik/rb-1xx.h | 2 +- .../arch/mips/adm5120/zyxel/p-33x.h | 2 +- .../files-2.6.26/drivers/net/adm5120sw.c | 6 ++--- .../drivers/watchdog/adm5120_wdt.c | 4 +-- .../mach-adm5120/{adm5120_irq.h => irq.h} | 26 ++++++++++--------- 16 files changed, 34 insertions(+), 42 deletions(-) rename target/linux/adm5120/files-2.6.26/include/asm-mips/mach-adm5120/{adm5120_irq.h => irq.h} (65%) diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.h b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.h index 70742e9b5..175fbb249 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.h +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/cellvision/cellvision.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -19,7 +20,6 @@ #include #include #include -#include extern void cellvision_mac_setup(void) __init; diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/board.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/board.c index bfd4bf8be..ffca7e01c 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/board.c +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/board.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -19,7 +20,6 @@ #include #include -#include #include #include @@ -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(); diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/gpio.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/gpio.c index bce3dddf9..aed003875 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/gpio.c +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/gpio.c @@ -13,17 +13,17 @@ #include #include #include +#include #include #include #include +#include #include -#include #include #include #include -#include #define GPIO_READ(r) __raw_readl((r)) #define GPIO_WRITE(v, r) __raw_writel((v), (r)) diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/irq.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/irq.c index ce303ec74..140a7a0e9 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/irq.c +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/irq.c @@ -12,17 +12,16 @@ #include #include #include +#include #include #include #include -#include #include #include #include #include -#include 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); diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/platform.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/platform.c index 5cae2023f..9526fe977 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/platform.c +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/platform.c @@ -16,12 +16,12 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/prom.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/prom.c index af2bfb5a5..260c4e5bb 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/prom.c +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/prom.c @@ -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(); } diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/setup.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/setup.c index 3a31917a2..0a1177462 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/setup.c +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/common/setup.c @@ -69,7 +69,7 @@ static void adm5120_halt(void) while (1) { if (cpu_wait) cpu_wait(); - }; + } } void __init plat_time_init(void) diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.c b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.c index 81157812b..d100bf034 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.c +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.c @@ -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]); } diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.h b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.h index 739a90d02..62425374a 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.h +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/compex/compex.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -19,6 +20,5 @@ #include #include #include -#include extern void compex_generic_setup(void) __init; diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/edimax/br-61xx.h b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/edimax/br-61xx.h index d7efda32d..f8ad137a4 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/edimax/br-61xx.h +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/edimax/br-61xx.h @@ -12,12 +12,12 @@ #include #include #include +#include #include #include #include -#include #include extern void __init br61xx_generic_setup(void) __init; diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/infineon/infineon.h b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/infineon/infineon.h index f3b28e088..2e25a8f3d 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/infineon/infineon.h +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/infineon/infineon.h @@ -12,12 +12,12 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/mikrotik/rb-1xx.h b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/mikrotik/rb-1xx.h index d5acef028..1577ed66d 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/mikrotik/rb-1xx.h +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/mikrotik/rb-1xx.h @@ -13,12 +13,12 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/zyxel/p-33x.h b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/zyxel/p-33x.h index 4817e8105..0971cd5d2 100644 --- a/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/zyxel/p-33x.h +++ b/target/linux/adm5120/files-2.6.26/arch/mips/adm5120/zyxel/p-33x.h @@ -12,11 +12,11 @@ #include #include #include +#include #include #include #include -#include extern void p33x_generic_setup(void) __init; diff --git a/target/linux/adm5120/files-2.6.26/drivers/net/adm5120sw.c b/target/linux/adm5120/files-2.6.26/drivers/net/adm5120sw.c index ff95ac009..7acc84d24 100644 --- a/target/linux/adm5120/files-2.6.26/drivers/net/adm5120sw.c +++ b/target/linux/adm5120/files-2.6.26/drivers/net/adm5120sw.c @@ -24,19 +24,17 @@ #include #include #include +#include +#include #include #include #include -#include -#include - #include #include #include -#include #include #include "adm5120sw.h" diff --git a/target/linux/adm5120/files-2.6.26/drivers/watchdog/adm5120_wdt.c b/target/linux/adm5120/files-2.6.26/drivers/watchdog/adm5120_wdt.c index 125a41f13..e92a89843 100644 --- a/target/linux/adm5120/files-2.6.26/drivers/watchdog/adm5120_wdt.c +++ b/target/linux/adm5120/files-2.6.26/drivers/watchdog/adm5120_wdt.c @@ -12,21 +12,19 @@ * 2 of the License, or (at your option) any later version. * */ - #include #include #include #include #include +#include #include #include #include -#include #include - #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/irq.h similarity index 65% rename from target/linux/adm5120/files-2.6.26/include/asm-mips/mach-adm5120/adm5120_irq.h rename to target/linux/adm5120/files-2.6.26/include/asm-mips/mach-adm5120/irq.h index d0dfb6e7e..b0350c8b8 100644 --- 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/irq.h @@ -8,24 +8,26 @@ * by the Free Software Foundation. * */ -#ifndef _MACH_ADM5120_IRQ_H -#define _MACH_ADM5120_IRQ_H +#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 #include -#define MIPS_IRQ_HW0 2 -#define MIPS_IRQ_COUNTER 7 -#define MIPS_IRQ_COUNT 8 +#define NO_IRQ (-1) -#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 MIPS_CPU_IRQ_COUNT 8 +#define MIPS_CPU_IRQ(x) (MIPS_CPU_IRQ_BASE + (x)) -#define ADM5120_CPU_IRQ(x) (ADM5120_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 ADM5120_CPU_IRQ(MIPS_IRQ_HW0) -#define ADM5120_IRQ_COUNTER ADM5120_CPU_IRQ(MIPS_IRQ_COUNTER) +#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) @@ -38,4 +40,4 @@ #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 */ +#endif /* _ASM_MIPS_MACH_ADM5120_IRQ_H */