diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2011-07-09 13:22:03 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-07-11 15:02:17 -0400 |
commit | 534e7a4566ca5fd3c0c92a655bcbaa6f9bd13042 (patch) | |
tree | d33ce90d22e75c305e8c1a1a1b4b0181379d16b7 /drivers/bcma/sprom.c | |
parent | edcc3604805b37344d0569b61a34dbe22943ba9f (diff) | |
download | linux-534e7a4566ca5fd3c0c92a655bcbaa6f9bd13042.tar.gz linux-534e7a4566ca5fd3c0c92a655bcbaa6f9bd13042.tar.bz2 linux-534e7a4566ca5fd3c0c92a655bcbaa6f9bd13042.zip |
bcma: add check if sprom is available before accessing it.
The SoCs like the bcm4716 do not have a sprom on the bcma bus like a
pcie device. It stores the values in some partition on flash memory.
For ssb this informations are read out in the bcm47xx arch code,
something like that should also be implemented for bcma. Without this
patch bcma panics on SoCs.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/sprom.c')
-rw-r--r-- | drivers/bcma/sprom.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c index ffbb0e32e921..8e8d5cf32e12 100644 --- a/drivers/bcma/sprom.c +++ b/drivers/bcma/sprom.c @@ -143,6 +143,9 @@ int bcma_sprom_get(struct bcma_bus *bus) if (!bus->drv_cc.core) return -EOPNOTSUPP; + if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM)) + return -ENOENT; + sprom = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16), GFP_KERNEL); if (!sprom) |