1 From 5972feafaa3c71c1497b4ef4101b3c6855b7b64e Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 19 Jun 2011 19:14:11 +0200
4 Subject: [PATCH 09/14] bcma: add check if sprom is available before accessing it.
7 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
9 drivers/bcma/main.c | 4 +++-
10 drivers/bcma/sprom.c | 3 +++
11 2 files changed, 6 insertions(+), 1 deletions(-)
13 --- a/drivers/bcma/main.c
14 +++ b/drivers/bcma/main.c
15 @@ -160,7 +160,9 @@ int bcma_bus_register(struct bcma_bus *b
17 /* Try to get SPROM */
18 err = bcma_sprom_get(bus);
20 + if (err == -ENOENT) {
21 + pr_err("No SPROM available\n");
23 pr_err("Failed to get SPROM: %d\n", err);
26 --- a/drivers/bcma/sprom.c
27 +++ b/drivers/bcma/sprom.c
28 @@ -143,6 +143,9 @@ int bcma_sprom_get(struct bcma_bus *bus)
29 if (!bus->drv_cc.core)
32 + if (!(bus->drv_cc.capabilities & BCMA_CC_CAP_SPROM))
35 sprom = kcalloc(SSB_SPROMSIZE_WORDS_R4, sizeof(u16),