brcm47xx: remove support for kernel 3.2
[openwrt.git] / target / linux / brcm47xx / patches-3.3 / 060-bcma-use-fallback-sprom-if-no-on-chip-sprom-is-avail.patch
1 --- a/drivers/bcma/sprom.c
2 +++ b/drivers/bcma/sprom.c
3 @@ -404,16 +404,19 @@ int bcma_sprom_get(struct bcma_bus *bus)
4                 return -EOPNOTSUPP;
5  
6         if (!bcma_sprom_ext_available(bus)) {
7 +               bool sprom_onchip;
8 +
9                 /*
10                  * External SPROM takes precedence so check
11                  * on-chip OTP only when no external SPROM
12                  * is present.
13                  */
14 -               if (bcma_sprom_onchip_available(bus)) {
15 +               sprom_onchip = bcma_sprom_onchip_available(bus);
16 +               if (sprom_onchip) {
17                         /* determine offset */
18                         offset = bcma_sprom_onchip_offset(bus);
19                 }
20 -               if (!offset) {
21 +               if (!offset || !sprom_onchip) {
22                         /*
23                          * Maybe there is no SPROM on the device?
24                          * Now we ask the arch code if there is some sprom