MIPS: BCM63xx: Fix build failure in board_bcm963xx.c
authorFlorian Fainelli <ffainelli@freebox.fr>
Tue, 23 Mar 2010 09:30:08 +0000 (10:30 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 12 Apr 2010 16:26:20 +0000 (17:26 +0100)
Since 2083e8327aeeaf818b0e4522a9d2539835c60423, the SPROM is now registered
in the board_prom_init callback, but it references variables and functions
which are declared below.  Move the variables and functions above
board_prom_init.

Signed-off-by: Florian Fainelli <ffainelli@freebox.fr>
To: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/1077/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/bcm63xx/boards/board_bcm963xx.c

index 5addb9c..8dba8cf 100644 (file)
@@ -618,6 +618,76 @@ static const struct board_info __initdata *bcm963xx_boards[] = {
 #endif
 };
 
+/*
+ * Register a sane SPROMv2 to make the on-board
+ * bcm4318 WLAN work
+ */
+#ifdef CONFIG_SSB_PCIHOST
+static struct ssb_sprom bcm63xx_sprom = {
+       .revision               = 0x02,
+       .board_rev              = 0x17,
+       .country_code           = 0x0,
+       .ant_available_bg       = 0x3,
+       .pa0b0                  = 0x15ae,
+       .pa0b1                  = 0xfa85,
+       .pa0b2                  = 0xfe8d,
+       .pa1b0                  = 0xffff,
+       .pa1b1                  = 0xffff,
+       .pa1b2                  = 0xffff,
+       .gpio0                  = 0xff,
+       .gpio1                  = 0xff,
+       .gpio2                  = 0xff,
+       .gpio3                  = 0xff,
+       .maxpwr_bg              = 0x004c,
+       .itssi_bg               = 0x00,
+       .boardflags_lo          = 0x2848,
+       .boardflags_hi          = 0x0000,
+};
+#endif
+
+/*
+ * return board name for /proc/cpuinfo
+ */
+const char *board_get_name(void)
+{
+       return board.name;
+}
+
+/*
+ * register & return a new board mac address
+ */
+static int board_get_mac_address(u8 *mac)
+{
+       u8 *p;
+       int count;
+
+       if (mac_addr_used >= nvram.mac_addr_count) {
+               printk(KERN_ERR PFX "not enough mac address\n");
+               return -ENODEV;
+       }
+
+       memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
+       p = mac + ETH_ALEN - 1;
+       count = mac_addr_used;
+
+       while (count--) {
+               do {
+                       (*p)++;
+                       if (*p != 0)
+                               break;
+                       p--;
+               } while (p != mac);
+       }
+
+       if (p == mac) {
+               printk(KERN_ERR PFX "unable to fetch mac address\n");
+               return -ENODEV;
+       }
+
+       mac_addr_used++;
+       return 0;
+}
+
 /*
  * early init callback, read nvram data from flash and checksum it
  */
@@ -744,49 +814,6 @@ void __init board_setup(void)
                panic("unexpected CPU for bcm963xx board");
 }
 
-/*
- * return board name for /proc/cpuinfo
- */
-const char *board_get_name(void)
-{
-       return board.name;
-}
-
-/*
- * register & return a new board mac address
- */
-static int board_get_mac_address(u8 *mac)
-{
-       u8 *p;
-       int count;
-
-       if (mac_addr_used >= nvram.mac_addr_count) {
-               printk(KERN_ERR PFX "not enough mac address\n");
-               return -ENODEV;
-       }
-
-       memcpy(mac, nvram.mac_addr_base, ETH_ALEN);
-       p = mac + ETH_ALEN - 1;
-       count = mac_addr_used;
-
-       while (count--) {
-               do {
-                       (*p)++;
-                       if (*p != 0)
-                               break;
-                       p--;
-               } while (p != mac);
-       }
-
-       if (p == mac) {
-               printk(KERN_ERR PFX "unable to fetch mac address\n");
-               return -ENODEV;
-       }
-
-       mac_addr_used++;
-       return 0;
-}
-
 static struct mtd_partition mtd_partitions[] = {
        {
                .name           = "cfe",
@@ -818,33 +845,6 @@ static struct platform_device mtd_dev = {
        },
 };
 
-/*
- * Register a sane SPROMv2 to make the on-board
- * bcm4318 WLAN work
- */
-#ifdef CONFIG_SSB_PCIHOST
-static struct ssb_sprom bcm63xx_sprom = {
-       .revision               = 0x02,
-       .board_rev              = 0x17,
-       .country_code           = 0x0,
-       .ant_available_bg       = 0x3,
-       .pa0b0                  = 0x15ae,
-       .pa0b1                  = 0xfa85,
-       .pa0b2                  = 0xfe8d,
-       .pa1b0                  = 0xffff,
-       .pa1b1                  = 0xffff,
-       .pa1b2                  = 0xffff,
-       .gpio0                  = 0xff,
-       .gpio1                  = 0xff,
-       .gpio2                  = 0xff,
-       .gpio3                  = 0xff,
-       .maxpwr_bg              = 0x004c,
-       .itssi_bg               = 0x00,
-       .boardflags_lo          = 0x2848,
-       .boardflags_hi          = 0x0000,
-};
-#endif
-
 static struct gpio_led_platform_data bcm63xx_led_data;
 
 static struct platform_device bcm63xx_gpio_leds = {