f4c2e265077ac00db02c7e273e089f24bd7c4dd3
[openwrt.git] / target / linux / brcm47xx / patches-3.3 / 231-bcma_reorder_sprom_fill.patch
1 --- a/arch/mips/bcm47xx/setup.c
2 +++ b/arch/mips/bcm47xx/setup.c
3 @@ -137,6 +137,7 @@ static int bcm47xx_get_sprom_ssb(struct
4         char prefix[10];
5  
6         if (bus->bustype == SSB_BUSTYPE_PCI) {
7 +               memset(out, 0, sizeof(struct ssb_sprom));
8                 snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
9                          bus->host_pci->bus->number + 1,
10                          PCI_SLOT(bus->host_pci->devfn));
11 @@ -165,6 +166,7 @@ static int bcm47xx_get_invariants(struct
12         if (nvram_getenv("boardrev", buf, sizeof(buf)) >= 0)
13                 iv->boardinfo.rev = (u16)simple_strtoul(buf, NULL, 0);
14  
15 +       memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
16         bcm47xx_fill_sprom(&iv->sprom, NULL);
17  
18         if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0)
19 @@ -263,12 +265,14 @@ static int bcm47xx_get_sprom_bcma(struct
20  
21         switch (bus->hosttype) {
22         case BCMA_HOSTTYPE_PCI:
23 +               memset(out, 0, sizeof(struct ssb_sprom));
24                 snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
25                          bus->host_pci->bus->number + 1,
26                          PCI_SLOT(bus->host_pci->devfn));
27                 bcm47xx_fill_sprom(out, prefix);
28                 return 0;
29         case BCMA_HOSTTYPE_SOC:
30 +               memset(out, 0, sizeof(struct ssb_sprom));
31                 bcm47xx_fill_sprom_ethernet(out, NULL);
32                 core = bcma_find_core(bus, BCMA_CORE_80211);
33                 if (core) {
34 --- a/arch/mips/bcm47xx/sprom.c
35 +++ b/arch/mips/bcm47xx/sprom.c
36 @@ -555,8 +555,6 @@ void bcm47xx_fill_sprom_ethernet(struct
37  
38  void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix)
39  {
40 -       memset(sprom, 0, sizeof(struct ssb_sprom));
41 -
42         bcm47xx_fill_sprom_ethernet(sprom, prefix);
43  
44         nvram_read_u8(prefix, NULL, "sromrev", &sprom->revision, 0);