MIPS: BCM63xx: Fix build failure in board_bcm963xx.c

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>

authored by

Florian Fainelli and committed by
Ralf Baechle
5e3644a9 5808184f

+70 -70
+70 -70
arch/mips/bcm63xx/boards/board_bcm963xx.c
··· 619 619 }; 620 620 621 621 /* 622 + * Register a sane SPROMv2 to make the on-board 623 + * bcm4318 WLAN work 624 + */ 625 + #ifdef CONFIG_SSB_PCIHOST 626 + static struct ssb_sprom bcm63xx_sprom = { 627 + .revision = 0x02, 628 + .board_rev = 0x17, 629 + .country_code = 0x0, 630 + .ant_available_bg = 0x3, 631 + .pa0b0 = 0x15ae, 632 + .pa0b1 = 0xfa85, 633 + .pa0b2 = 0xfe8d, 634 + .pa1b0 = 0xffff, 635 + .pa1b1 = 0xffff, 636 + .pa1b2 = 0xffff, 637 + .gpio0 = 0xff, 638 + .gpio1 = 0xff, 639 + .gpio2 = 0xff, 640 + .gpio3 = 0xff, 641 + .maxpwr_bg = 0x004c, 642 + .itssi_bg = 0x00, 643 + .boardflags_lo = 0x2848, 644 + .boardflags_hi = 0x0000, 645 + }; 646 + #endif 647 + 648 + /* 649 + * return board name for /proc/cpuinfo 650 + */ 651 + const char *board_get_name(void) 652 + { 653 + return board.name; 654 + } 655 + 656 + /* 657 + * register & return a new board mac address 658 + */ 659 + static int board_get_mac_address(u8 *mac) 660 + { 661 + u8 *p; 662 + int count; 663 + 664 + if (mac_addr_used >= nvram.mac_addr_count) { 665 + printk(KERN_ERR PFX "not enough mac address\n"); 666 + return -ENODEV; 667 + } 668 + 669 + memcpy(mac, nvram.mac_addr_base, ETH_ALEN); 670 + p = mac + ETH_ALEN - 1; 671 + count = mac_addr_used; 672 + 673 + while (count--) { 674 + do { 675 + (*p)++; 676 + if (*p != 0) 677 + break; 678 + p--; 679 + } while (p != mac); 680 + } 681 + 682 + if (p == mac) { 683 + printk(KERN_ERR PFX "unable to fetch mac address\n"); 684 + return -ENODEV; 685 + } 686 + 687 + mac_addr_used++; 688 + return 0; 689 + } 690 + 691 + /* 622 692 * early init callback, read nvram data from flash and checksum it 623 693 */ 624 694 void __init board_prom_init(void) ··· 814 744 panic("unexpected CPU for bcm963xx board"); 815 745 } 816 746 817 - /* 818 - * return board name for /proc/cpuinfo 819 - */ 820 - const char *board_get_name(void) 821 - { 822 - return board.name; 823 - } 824 - 825 - /* 826 - * register & return a new board mac address 827 - */ 828 - static int board_get_mac_address(u8 *mac) 829 - { 830 - u8 *p; 831 - int count; 832 - 833 - if (mac_addr_used >= nvram.mac_addr_count) { 834 - printk(KERN_ERR PFX "not enough mac address\n"); 835 - return -ENODEV; 836 - } 837 - 838 - memcpy(mac, nvram.mac_addr_base, ETH_ALEN); 839 - p = mac + ETH_ALEN - 1; 840 - count = mac_addr_used; 841 - 842 - while (count--) { 843 - do { 844 - (*p)++; 845 - if (*p != 0) 846 - break; 847 - p--; 848 - } while (p != mac); 849 - } 850 - 851 - if (p == mac) { 852 - printk(KERN_ERR PFX "unable to fetch mac address\n"); 853 - return -ENODEV; 854 - } 855 - 856 - mac_addr_used++; 857 - return 0; 858 - } 859 - 860 747 static struct mtd_partition mtd_partitions[] = { 861 748 { 862 749 .name = "cfe", ··· 844 817 .platform_data = &flash_data, 845 818 }, 846 819 }; 847 - 848 - /* 849 - * Register a sane SPROMv2 to make the on-board 850 - * bcm4318 WLAN work 851 - */ 852 - #ifdef CONFIG_SSB_PCIHOST 853 - static struct ssb_sprom bcm63xx_sprom = { 854 - .revision = 0x02, 855 - .board_rev = 0x17, 856 - .country_code = 0x0, 857 - .ant_available_bg = 0x3, 858 - .pa0b0 = 0x15ae, 859 - .pa0b1 = 0xfa85, 860 - .pa0b2 = 0xfe8d, 861 - .pa1b0 = 0xffff, 862 - .pa1b1 = 0xffff, 863 - .pa1b2 = 0xffff, 864 - .gpio0 = 0xff, 865 - .gpio1 = 0xff, 866 - .gpio2 = 0xff, 867 - .gpio3 = 0xff, 868 - .maxpwr_bg = 0x004c, 869 - .itssi_bg = 0x00, 870 - .boardflags_lo = 0x2848, 871 - .boardflags_hi = 0x0000, 872 - }; 873 - #endif 874 820 875 821 static struct gpio_led_platform_data bcm63xx_led_data; 876 822