ramips: rt305x: remove per-board physmap_flash_data instances
authorGabor Juhos <juhosg@openwrt.org>
Sun, 12 Feb 2012 12:52:10 +0000 (12:52 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 12 Feb 2012 12:52:10 +0000 (12:52 +0000)
SVN-Revision: 30473

21 files changed:
target/linux/ramips/files/arch/mips/ralink/rt305x/devices.c
target/linux/ramips/files/arch/mips/ralink/rt305x/devices.h
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-argus-atp52b.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-bc2.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-dir-300-revb.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-esr-9753.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-f5d8235-v2.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-fonera20n.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-hw550-3g.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-mofi3500-3gn.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-nbg-419n.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-omni-emb.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-pwh2004.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-v22rw-2x2.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-w502u.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wcr150gn.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-whr-g300n.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wl341v3.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wl351.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wr512-3gn.c
target/linux/ramips/files/arch/mips/ralink/rt305x/mach-wr6202.c

index 615f32dacccf62ef2791c182a83747b98eff4723..a162515c0574a302b60ac8d687dd14066f722cd5 100644 (file)
@@ -35,10 +35,14 @@ static struct resource rt305x_flash0_resources[] = {
        },
 };
 
+struct physmap_flash_data rt305x_flash0_data;
 static struct platform_device rt305x_flash0_device = {
        .name           = "physmap-flash",
        .resource       = rt305x_flash0_resources,
        .num_resources  = ARRAY_SIZE(rt305x_flash0_resources),
+       .dev = {
+               .platform_data = &rt305x_flash0_data,
+       },
 };
 
 static struct resource rt305x_flash1_resources[] = {
@@ -50,17 +54,21 @@ static struct resource rt305x_flash1_resources[] = {
        },
 };
 
+struct physmap_flash_data rt305x_flash1_data;
 static struct platform_device rt305x_flash1_device = {
        .name           = "physmap-flash",
        .resource       = rt305x_flash1_resources,
        .num_resources  = ARRAY_SIZE(rt305x_flash1_resources),
+       .dev = {
+               .platform_data = &rt305x_flash1_data,
+       },
 };
 
 static int rt305x_flash_instance __initdata;
-void __init rt305x_register_flash(unsigned int id,
-                                 struct physmap_flash_data *pdata)
+void __init rt305x_register_flash(unsigned int id)
 {
        struct platform_device *pdev;
+       struct physmap_flash_data *pdata;
        u32 t;
        int reg;
 
@@ -80,6 +88,7 @@ void __init rt305x_register_flash(unsigned int id,
        t = rt305x_memc_rr(reg);
        t = (t >> FLASH_CFG_WIDTH_SHIFT) & FLASH_CFG_WIDTH_MASK;
 
+       pdata = pdev->dev.platform_data;
        switch (t) {
        case FLASH_CFG_WIDTH_8BIT:
                pdata->width = 1;
@@ -95,7 +104,6 @@ void __init rt305x_register_flash(unsigned int id,
                return;
        }
 
-       pdev->dev.platform_data = pdata;
        pdev->id = rt305x_flash_instance;
 
        platform_device_register(pdev);
index 22dc5ea12dd28e4c6971c2b711404e1c6f4634e5..22c9ce4232870d8663a5add6ad126ec78df3121c 100644 (file)
 struct physmap_flash_data;
 struct spi_board_info;
 
+extern struct physmap_flash_data rt305x_flash0_data;
+extern struct physmap_flash_data rt305x_flash1_data;
+
 extern struct rt305x_esw_platform_data rt305x_esw_data;
 
-void rt305x_register_flash(unsigned int id, struct physmap_flash_data *pdata);
+void rt305x_register_flash(unsigned int id);
 void rt305x_register_ethernet(void);
 void rt305x_register_wifi(void);
 void rt305x_register_wdt(void);
index 00832f13bb18fbf2f42292f54e8071b0a046d0fc..14e4e98fb9b7c8e44c3a287c276e7a1c78d18d54 100644 (file)
@@ -89,15 +89,14 @@ static struct mtd_partition argus_atp52b_partitions[] = {
        }
 };
 
-static struct physmap_flash_data argus_atp52b_flash_data = {
-       .nr_parts       = ARRAY_SIZE(argus_atp52b_partitions),
-       .parts          = argus_atp52b_partitions,
-};
-
 static void __init argus_atp52b_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
-       rt305x_register_flash(0, &argus_atp52b_flash_data);
+
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(argus_atp52b_partitions);
+       rt305x_flash0_data.parts = argus_atp52b_partitions;
+       rt305x_register_flash(0);
+
        ramips_register_gpio_leds(-1, ARRAY_SIZE(argus_atp52b_leds_gpio),
                                        argus_atp52b_leds_gpio);
        ramips_register_gpio_buttons(-1, ARGUS_ATP52B_KEYS_POLL_INTERVAL,
index 4b03b776c7e2a4c5486b1122a2c0f7a1d85f7a51..25a8714b5d34967b1570496cb87572e0b6681b74 100644 (file)
@@ -59,11 +59,6 @@ static struct mtd_partition bc2_partitions[] = {
        }
 };
 
-static struct physmap_flash_data bc2_flash_data = {
-       .nr_parts       = ARRAY_SIZE(bc2_partitions),
-       .parts          = bc2_partitions,
-};
-
 static struct gpio_led bc2_leds_gpio[] __initdata = {
        {
                .name           = "bc2:blue:usb",
@@ -89,7 +84,9 @@ static void __init bc2_init(void)
                          RT305X_GPIO_MODE_UART0_SHIFT) |
                          RT305X_GPIO_MODE_JTAG);
 
-       rt305x_register_flash(0, &bc2_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(bc2_partitions);
+       rt305x_flash0_data.parts = bc2_partitions;
+       rt305x_register_flash(0);
 
        ramips_register_gpio_leds(-1, ARRAY_SIZE(bc2_leds_gpio),
                                  bc2_leds_gpio);
index b84d9ed9f4a8e3330cdbd472956e7ac1e1ef5a10..f660272bc5eb2f7cb33f3f391bb53c9ce164d09b 100644 (file)
@@ -63,11 +63,6 @@ static struct mtd_partition dir_300b_partitions[] = {
        }
 };
 
-static struct physmap_flash_data dir_300b_flash_data = {
-       .nr_parts       = ARRAY_SIZE(dir_300b_partitions),
-       .parts          = dir_300b_partitions,
-};
-
 static struct gpio_led dir_300b_leds_gpio[] __initdata = {
        {
                .name           = "d-link:amber:status",
@@ -106,7 +101,10 @@ static void __init dir_300b_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
 
-       rt305x_register_flash(0, &dir_300b_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(dir_300b_partitions);
+       rt305x_flash0_data.parts = dir_300b_partitions;
+       rt305x_register_flash(0);
+
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(dir_300b_leds_gpio),
index 371487a2172fef2efca293a184bbf2550d9ee31c..6e0799b9944577a1cd14fc76c448517d74580b2c 100644 (file)
@@ -62,11 +62,6 @@ static struct mtd_partition esr_9753_partitions[] = {
        }
 };
 
-static struct physmap_flash_data esr_9753_flash_data = {
-       .nr_parts       = ARRAY_SIZE(esr_9753_partitions),
-       .parts          = esr_9753_partitions,
-};
-
 static struct gpio_led esr_9753_leds_gpio[] __initdata = {
        {
                .name           = "esr-9753:orange:power",
@@ -101,7 +96,9 @@ static void __init esr_9753_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
 
-       rt305x_register_flash(0, &esr_9753_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(esr_9753_partitions);
+       rt305x_flash0_data.parts = esr_9753_partitions;
+       rt305x_register_flash(0);
 
        ramips_register_gpio_leds(-1, ARRAY_SIZE(esr_9753_leds_gpio),
                                  esr_9753_leds_gpio);
index 6b25c8c3e91c723e34f03c9717614d3c2c822fa5..6bcca6024b4218372f8e72ea78092eefeba584c0 100644 (file)
@@ -99,12 +99,6 @@ static struct mtd_partition f5d8235v2_partitions[] = {
        }
 };
 
-static struct physmap_flash_data f5d8235v2_flash_data = {
-       .nr_parts       = ARRAY_SIZE(f5d8235v2_partitions),
-       .parts          = f5d8235v2_partitions,
-};
-
-
 static struct rtl8366_platform_data f5d8235v2_switch_data = {
        .gpio_sda       = RT305X_GPIO_I2C_SD,
        .gpio_sck       = RT305X_GPIO_I2C_SCLK,
@@ -125,7 +119,11 @@ static void __init f5d8235v2_init(void)
                                        RT305X_GPIO_MODE_I2C |
                                        RT305X_GPIO_MODE_SPI |
                                        RT305X_GPIO_MODE_MDIO);
-       rt305x_register_flash(0, &f5d8235v2_flash_data);
+
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(f5d8235v2_partitions);
+       rt305x_flash0_data.parts = f5d8235v2_partitions;
+       rt305x_register_flash(0);
+
        ramips_register_gpio_leds(-1, ARRAY_SIZE(f5d8235v2_leds_gpio),
                                                f5d8235v2_leds_gpio);
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_NONE;
index 5955f6391800ad577879abdefc2c6e5f9ee45409..f68f4640ef23b68ab049128db991d73c9bd92a72 100644 (file)
@@ -63,11 +63,6 @@ static struct mtd_partition fonera20n_partitions[] = {
        }
 };
 
-static struct physmap_flash_data fonera20n_flash_data = {
-       .nr_parts       = ARRAY_SIZE(fonera20n_partitions),
-       .parts          = fonera20n_partitions,
-};
-
 static struct gpio_led fonera20n_leds_gpio[] __initdata = {
        {
                .name           = "fonera20n:orange:wifi",
@@ -106,7 +101,9 @@ static void __init fonera20n_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
 
-       rt305x_register_flash(0, &fonera20n_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(fonera20n_partitions);
+       rt305x_flash0_data.parts = fonera20n_partitions;
+       rt305x_register_flash(0);
 
        ramips_register_gpio_leds(-1, ARRAY_SIZE(fonera20n_leds_gpio),
                                  fonera20n_leds_gpio);
index 08ee40a9148d85310e8bcca117ddd111142691af..ce328988ea1bf9eb27536b0ceaf543c9f335438e 100644 (file)
@@ -65,11 +65,6 @@ static struct mtd_partition hw550_3g_partitions[] = {
        }
 };
 
-static struct physmap_flash_data hw550_3g_flash_data = {
-       .nr_parts       = ARRAY_SIZE(hw550_3g_partitions),
-       .parts          = hw550_3g_partitions,
-};
-
 static struct gpio_led hw550_3g_leds_gpio[] __initdata = {
        {
                .name           = "hw550-3g:green:usb",
@@ -123,7 +118,10 @@ static void __init hw550_3g_init(void)
 {
        rt305x_gpio_init(HW550_3G_GPIO_MODE);
 
-       rt305x_register_flash(0, &hw550_3g_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(hw550_3g_partitions);
+       rt305x_flash0_data.parts = hw550_3g_partitions;
+       rt305x_register_flash(0);
+
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL;
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(hw550_3g_leds_gpio),
index fa046df9fe21a336ccc94b8c25d0107b4332dd91..62faf554fb0f3724d9c0866de534cb316b78c7dc 100644 (file)
@@ -65,11 +65,6 @@ static struct mtd_partition mofi3500_3gn_partitions[] = {
        }
 };
 
-static struct physmap_flash_data mofi3500_3gn_flash_data = {
-       .nr_parts       = ARRAY_SIZE(mofi3500_3gn_partitions),
-       .parts          = mofi3500_3gn_partitions,
-};
-
 static struct gpio_led mofi3500_3gn_leds_gpio[] __initdata = {
        {
                .name           = "mofi3500-3gn:green:usb",
@@ -123,7 +118,10 @@ static void __init mofi3500_3gn_init(void)
 {
        rt305x_gpio_init(MOFI3500_3GN_GPIO_MODE);
 
-       rt305x_register_flash(0, &mofi3500_3gn_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(mofi3500_3gn_partitions);
+       rt305x_flash0_data.parts = mofi3500_3gn_partitions;
+       rt305x_register_flash(0);
+
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(mofi3500_3gn_leds_gpio),
index afe51d71e8201413b18404355552dba29654c42f..4410b032c4260936425cdad8721c7bb0b0986f0a 100644 (file)
@@ -54,11 +54,6 @@ static struct mtd_partition nbg_419n_partitions[] = {
        }
 };
 
-static struct physmap_flash_data nbg_419n_flash_data = {
-       .nr_parts       = ARRAY_SIZE(nbg_419n_partitions),
-       .parts          = nbg_419n_partitions,
-};
-
 static struct gpio_led nbg_419n_leds_gpio[] __initdata = {
        {
                .name           = "nbg-419n:green:power",
@@ -93,7 +88,10 @@ static void __init nbg_419n_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
 
-       rt305x_register_flash(0, &nbg_419n_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(nbg_419n_partitions);
+       rt305x_flash0_data.parts = nbg_419n_partitions;
+       rt305x_register_flash(0);
+
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(nbg_419n_leds_gpio),
index 149609956af2e72eea10ff7a6b66d85726cc3f89..50cc0bcb28197efea003e30ba5a1b3325305d0ca 100644 (file)
@@ -61,11 +61,6 @@ static struct mtd_partition emb_partitions[] = {
        }
 };
 
-static struct physmap_flash_data omni_emb_flash_data = {
-       .nr_parts       = ARRAY_SIZE(emb_partitions),
-       .parts          = emb_partitions,
-};
-
 static struct gpio_led omni_emb_leds_gpio[] __initdata = {
        {
                .name           = "emb:green:status",
@@ -101,7 +96,10 @@ static void __init omni_emb_init(void)
                                ARRAY_SIZE(omni_emb_gpio_buttons),
                                omni_emb_gpio_buttons);
 
-       rt305x_register_flash(0, &omni_emb_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(emb_partitions);
+       rt305x_flash0_data.parts = emb_partitions;
+       rt305x_register_flash(0);
+
        rt305x_register_ethernet();
        rt305x_register_wifi();
        rt305x_register_wdt();
index dc02f49638fd58e99272f51d2ac66843323fa01e..e544fe6967254412f3faece5d846037262c675f8 100644 (file)
@@ -55,11 +55,6 @@ static struct mtd_partition pwh2004_partitions[] = {
        }
 };
 
-static struct physmap_flash_data pwh2004_flash_data = {
-       .nr_parts       = ARRAY_SIZE(pwh2004_partitions),
-       .parts          = pwh2004_partitions,
-};
-
 static struct gpio_led pwh2004_leds_gpio[] __initdata = {
        {
                .name           = "pwh2004:red:wifi",
@@ -86,7 +81,11 @@ static struct gpio_keys_button pwh2004_gpio_buttons[] __initdata = {
 static void __init pwh2004_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
-       rt305x_register_flash(0, &pwh2004_flash_data);
+
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(pwh2004_partitions);
+       rt305x_flash0_data.parts = pwh2004_partitions;
+       rt305x_register_flash(0);
+
        ramips_register_gpio_leds(-1, ARRAY_SIZE(pwh2004_leds_gpio),
                                  pwh2004_leds_gpio);
        ramips_register_gpio_buttons(-1, PWH2004_KEYS_POLL_INTERVAL,
index acef9780718b1060de122235dbe11c2428f24e46..cbbf73001ab547d3737a6972f9377939d75638f8 100644 (file)
@@ -61,11 +61,6 @@ static struct mtd_partition v22rw_2x2_partitions[] = {
        }
 };
 
-static struct physmap_flash_data v22rw_2x2_flash_data = {
-       .nr_parts       = ARRAY_SIZE(v22rw_2x2_partitions),
-       .parts          = v22rw_2x2_partitions,
-};
-
 static struct gpio_led v22rw_2x2_leds_gpio[] __initdata = {
        {
                .name           = "v22rw-2x2:green:security",
@@ -100,7 +95,10 @@ static void __init v22rw_2x2_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
 
-       rt305x_register_flash(0, &v22rw_2x2_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(v22rw_2x2_partitions);
+       rt305x_flash0_data.parts = v22rw_2x2_partitions;
+       rt305x_register_flash(0);
+
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(v22rw_2x2_leds_gpio),
index 390388b1ce604e15ab63ac9e8e146ab76aa909f8..4e9dd1821949a6a4db04054f155db20a806edc06 100644 (file)
@@ -67,11 +67,6 @@ static struct mtd_partition w502u_partitions[] = {
        }
 };
 
-static struct physmap_flash_data w502u_flash_data = {
-       .nr_parts       = ARRAY_SIZE(w502u_partitions),
-       .parts          = w502u_partitions,
-};
-
 static struct gpio_led w502u_leds_gpio[] __initdata = {
        {
                .name           = "alfa:blue:usb",
@@ -109,7 +104,10 @@ static void __init w502u_init(void)
        rt305x_gpio_init((RT305X_GPIO_MODE_GPIO <<
                          RT305X_GPIO_MODE_UART0_SHIFT));
 
-       rt305x_register_flash(0, &w502u_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(w502u_partitions);
+       rt305x_flash0_data.parts = w502u_partitions;
+       rt305x_register_flash(0);
+
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL;
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(w502u_leds_gpio),
index 07ae825cb1806dd966d67b452a787223aa849cc9..1c0667b065c83ea84495644e078d64539cce917c 100644 (file)
@@ -92,15 +92,14 @@ static struct mtd_partition wcr150gn_partitions[] = {
        }
 };
 
-static struct physmap_flash_data wcr150gn_flash_data = {
-       .nr_parts       = ARRAY_SIZE(wcr150gn_partitions),
-       .parts          = wcr150gn_partitions,
-};
-
 static void __init wcr150gn_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
-       rt305x_register_flash(0, &wcr150gn_flash_data);
+
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(wcr150gn_partitions);
+       rt305x_flash0_data.parts = wcr150gn_partitions;
+       rt305x_register_flash(0);
+
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wcr150gn_leds_gpio),
                                  wcr150gn_leds_gpio);
        ramips_register_gpio_buttons(-1, WCR150GN_KEYS_POLL_INTERVAL,
index 6d6dc7f60fb1c4db5af004b466a5a6920e600ddd..fdcd6b320474cb9cbe4dbb45059293c907091e39 100644 (file)
@@ -69,11 +69,6 @@ static struct mtd_partition whr_g300n_partitions[] = {
        }
 };
 
-static struct physmap_flash_data whr_g300n_flash_data = {
-       .nr_parts       = ARRAY_SIZE(whr_g300n_partitions),
-       .parts          = whr_g300n_partitions,
-};
-
 static struct gpio_led whr_g300n_leds_gpio[] __initdata = {
        {
                .name           = "whr-g300n:red:diag",
@@ -126,7 +121,10 @@ static void __init whr_g300n_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
 
-       rt305x_register_flash(0, &whr_g300n_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(whr_g300n_partitions);
+       rt305x_flash0_data.parts = whr_g300n_partitions;
+       rt305x_register_flash(0);
+
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(whr_g300n_leds_gpio),
index f737fe523d72b20e154474ba11023b045b3d5f25..34d9cfe5c4103d1280f5addd5a379cdce4fe3218 100644 (file)
@@ -75,11 +75,6 @@ static struct mtd_partition wl341v3_partitions[] = {
        }
 };
 
-static struct physmap_flash_data wl341v3_flash_data = {
-       .nr_parts       = ARRAY_SIZE(wl341v3_partitions),
-       .parts          = wl341v3_partitions,
-};
-
 static struct gpio_led wl341v3_leds_gpio[] __initdata = {
        {
                .name           = "wl341v3:amber:first",
@@ -134,7 +129,10 @@ static void __init wl341v3_init(void)
 {
        rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
 
-       rt305x_register_flash(0, &wl341v3_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(wl341v3_partitions);
+       rt305x_flash0_data.parts = wl341v3_partitions;
+       rt305x_register_flash(0);
+
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_WLLLL;
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wl341v3_leds_gpio),
index 9d227b66b8dfd65ff4034531fd536b77c1ebdd12..8d37f8f87d183da81fb7ec269645c0c66caac771 100644 (file)
@@ -104,12 +104,6 @@ static struct mtd_partition wl351_partitions[] = {
        }
 };
 
-static struct physmap_flash_data wl351_flash_data = {
-       .nr_parts       = ARRAY_SIZE(wl351_partitions),
-       .parts          = wl351_partitions,
-};
-
-
 static struct rtl8366_platform_data wl351_switch_data = {
        .gpio_sda       = RT305X_GPIO_I2C_SD,
        .gpio_sck       = RT305X_GPIO_I2C_SCLK,
@@ -130,7 +124,11 @@ static void __init wl351_init(void)
                                RT305X_GPIO_MODE_I2C |
                                RT305X_GPIO_MODE_SPI |
                                RT305X_GPIO_MODE_MDIO);
-       rt305x_register_flash(0, &wl351_flash_data);
+
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(wl351_partitions);
+       rt305x_flash0_data.parts = wl351_partitions;
+       rt305x_register_flash(0);
+
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wl351_leds_gpio),
                                                wl351_leds_gpio);
        ramips_register_gpio_buttons(-1, WL351_KEYS_POLL_INTERVAL,
index 201823c49c2f56c00df7c3633c6216b2d3e6f0f5..b1c51bb09311bda679425714743108e2db19d549 100644 (file)
@@ -76,11 +76,6 @@ static struct mtd_partition wr512_3gn_partitions[] = {
        }
 };
 
-static struct physmap_flash_data wr512_3gn_flash_data = {
-       .nr_parts       = ARRAY_SIZE(wr512_3gn_partitions),
-       .parts          = wr512_3gn_partitions,
-};
-
 static struct gpio_led wr512_3gn_leds_gpio[] __initdata = {
        {
                .name           = "wr512:green:3g",
@@ -131,7 +126,10 @@ static void __init wr512_3gn_init(void)
 {
        rt305x_gpio_init(WR512_3GN_GPIO_MODE);
 
-       rt305x_register_flash(0, &wr512_3gn_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(wr512_3gn_partitions);
+       rt305x_flash0_data.parts = wr512_3gn_partitions;
+       rt305x_register_flash(0);
+
        rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
        rt305x_register_ethernet();
        ramips_register_gpio_leds(-1, ARRAY_SIZE(wr512_3gn_leds_gpio),
index c63adb96dda853f51b7436a71b5060e38bc5e282..09940cc02f0551e7d65f5cfccc40f94c18d43c0f 100644 (file)
@@ -60,11 +60,6 @@ static struct mtd_partition wr6202_partitions[] = {
        }
 };
 
-static struct physmap_flash_data wr6202_flash_data = {
-       .nr_parts       = ARRAY_SIZE(wr6202_partitions),
-       .parts          = wr6202_partitions,
-};
-
 static struct gpio_led wr6202_leds_gpio[] __initdata = {
        {
                .name           = "wr6202:blue:wps",
@@ -112,7 +107,10 @@ static void __init wr6202_init(void)
        gpio_direction_output(WR6202_GPIO_USB_POWER, 0);
        gpio_free(WR6202_GPIO_USB_POWER);
 
-       rt305x_register_flash(0, &wr6202_flash_data);
+       rt305x_flash0_data.nr_parts = ARRAY_SIZE(wr6202_partitions);
+       rt305x_flash0_data.parts = wr6202_partitions;
+       rt305x_register_flash(0);
+
        rt305x_register_ethernet();
        rt305x_register_wifi();
        rt305x_register_wdt();