aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2008-12-20 07:47:30 +0000
committerGabor Juhos <juhosg@openwrt.org>2008-12-20 07:47:30 +0000
commit013387f3baab87baa39d5caae49f3c8c1a269da9 (patch)
tree57d7b571e6f50e260d352eabb81b5510f09dd346 /target
parent0e2abca3511acde50dca5be832b5082d2596643e (diff)
downloadupstream-013387f3baab87baa39d5caae49f3c8c1a269da9.tar.gz
upstream-013387f3baab87baa39d5caae49f3c8c1a269da9.tar.bz2
upstream-013387f3baab87baa39d5caae49f3c8c1a269da9.zip
[ar71xx] rb-4xx: setup code cleanup
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13698 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c53
1 files changed, 16 insertions, 37 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
index 864de882d8..f8e76c40c6 100644
--- a/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
+++ b/target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb-4xx.c
@@ -150,8 +150,21 @@ static inline void rb4xx_add_device_spi(void) {}
static inline void rb433_add_device_spi(void) {}
#endif
+static void __init rb4xx_generic_setup(void)
+{
+ ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
+ rb4xx_leds_gpio);
+
+ ar71xx_add_device_gpio_buttons(-1, RB4XX_BUTTONS_POLL_INTERVAL,
+ ARRAY_SIZE(rb4xx_gpio_buttons),
+ rb4xx_gpio_buttons);
+
+ platform_device_register(&rb4xx_nand_device);
+}
+
static void __init rb411_setup(void)
{
+ rb4xx_generic_setup();
rb4xx_add_device_spi();
ar71xx_add_device_mdio(0xfffffffe);
@@ -161,15 +174,6 @@ static void __init rb411_setup(void)
ar71xx_add_device_eth(0);
- ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
- rb4xx_leds_gpio);
-
- ar71xx_add_device_gpio_buttons(-1, RB4XX_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(rb4xx_gpio_buttons),
- rb4xx_gpio_buttons);
-
- platform_device_register(&rb4xx_nand_device);
-
ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}
@@ -177,6 +181,7 @@ MIPS_MACHINE(AR71XX_MACH_RB_411, "MikroTik RouterBOARD 411/A/AH", rb411_setup);
static void __init rb433_setup(void)
{
+ rb4xx_generic_setup();
rb433_add_device_spi();
ar71xx_add_device_mdio(0xffffffe9);
@@ -192,15 +197,6 @@ static void __init rb433_setup(void)
ar71xx_add_device_eth(1);
ar71xx_add_device_eth(0);
- ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
- rb4xx_leds_gpio);
-
- ar71xx_add_device_gpio_buttons(-1, RB4XX_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(rb4xx_gpio_buttons),
- rb4xx_gpio_buttons);
-
- platform_device_register(&rb4xx_nand_device);
-
ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}
@@ -208,6 +204,7 @@ MIPS_MACHINE(AR71XX_MACH_RB_433, "MikroTik RouterBOARD 433/AH", rb433_setup);
static void __init rb450_setup(void)
{
+ rb4xx_generic_setup();
rb4xx_add_device_spi();
ar71xx_add_device_mdio(0xffffffe0);
@@ -222,21 +219,13 @@ static void __init rb450_setup(void)
ar71xx_add_device_eth(1);
ar71xx_add_device_eth(0);
-
- ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
- rb4xx_leds_gpio);
-
- ar71xx_add_device_gpio_buttons(-1, RB4XX_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(rb4xx_gpio_buttons),
- rb4xx_gpio_buttons);
-
- platform_device_register(&rb4xx_nand_device);
}
MIPS_MACHINE(AR71XX_MACH_RB_450, "MikroTik RouterBOARD 450", rb450_setup);
static void __init rb493_setup(void)
{
+ rb4xx_generic_setup();
rb4xx_add_device_spi();
ar71xx_add_device_mdio(0x3fffff00);
@@ -252,17 +241,7 @@ static void __init rb493_setup(void)
ar71xx_add_device_eth(0);
ar71xx_add_device_eth(1);
- ar71xx_add_device_leds_gpio(-1, ARRAY_SIZE(rb4xx_leds_gpio),
- rb4xx_leds_gpio);
-
- ar71xx_add_device_gpio_buttons(-1, RB4XX_BUTTONS_POLL_INTERVAL,
- ARRAY_SIZE(rb4xx_gpio_buttons),
- rb4xx_gpio_buttons);
-
- platform_device_register(&rb4xx_nand_device);
-
ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
}
MIPS_MACHINE(AR71XX_MACH_RB_493, "MikroTik RouterBOARD 493/AH", rb493_setup);
-