linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: linux-wireless@vger.kernel.org, zajec5@gmail.com,
	linux-mips@linux-mips.org
Cc: mb@bu3sch.de, george@znau.edu.ua, arend@broadcom.com,
	b43-dev@lists.infradead.org, bernhardloos@googlemail.com,
	arnd@arndb.de, julian.calaby@gmail.com, sshtylyov@mvista.com,
	Hauke Mehrtens <hauke@hauke-m.de>
Subject: [RFC v3 09/13] bcma: add check if sprom is available before accessing it.
Date: Thu, 30 Jun 2011 00:11:54 +0200	[thread overview]
Message-ID: <1309385518-12097-10-git-send-email-hauke@hauke-m.de> (raw)
In-Reply-To: <1309385518-12097-1-git-send-email-hauke@hauke-m.de>


Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/bcma/main.c  |    4 +++-
 drivers/bcma/sprom.c |    3 +++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 7dd0b16..2750aa5 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -160,7 +160,9 @@ int bcma_bus_register(struct bcma_bus *bus)
 
 	/* Try to get SPROM */
 	err = bcma_sprom_get(bus);
-	if (err) {
+	if (err == -ENOENT) {
+		pr_err("No SPROM available\n");
+	} else if (err) {
 		pr_err("Failed to get SPROM: %d\n", err);
 		return -ENOENT;
 	}
diff --git a/drivers/bcma/sprom.c b/drivers/bcma/sprom.c
index ffbb0e3..8e8d5cf 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)
-- 
1.7.4.1


  parent reply	other threads:[~2011-06-29 22:12 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29 22:11 [RFC v3 00/13] bcma: add support for embedded devices like bcm4716 Hauke Mehrtens
2011-06-29 22:11 ` [RFC v3 01/13] bcma: move parsing of EEPROM into own function Hauke Mehrtens
2011-06-29 22:11 ` [RFC v3 02/13] bcma: move initializing of struct bcma_bus to " Hauke Mehrtens
2011-06-29 22:11 ` [RFC v3 03/13] bcma: add functions to scan cores needed on SoCs Hauke Mehrtens
2011-06-30  6:42   ` Rafał Miłecki
2011-06-30  7:23     ` Hauke Mehrtens
2011-06-29 22:11 ` [RFC v3 04/13] bcma: add SOC bus Hauke Mehrtens
2011-06-29 22:11 ` [RFC v3 05/13] bcma: add mips driver Hauke Mehrtens
2011-06-29 22:11 ` [RFC v3 06/13] bcma: add serial console support Hauke Mehrtens
2011-06-29 22:11 ` [RFC v3 07/13] bcma: get CPU clock Hauke Mehrtens
2011-06-29 22:11 ` [RFC v3 08/13] bcma: add pci(e) host mode Hauke Mehrtens
2011-06-29 22:11 ` Hauke Mehrtens [this message]
2011-06-29 22:11 ` [RFC v3 10/13] bcm47xx: prepare to support different buses Hauke Mehrtens
2011-06-29 22:11 ` [RFC v3 11/13] bcm47xx: make it possible to build bcm47xx without ssb Hauke Mehrtens
2011-06-30  8:31   ` Florian Fainelli
2011-06-29 22:11 ` [RFC v3 12/13] bcm47xx: add support for bcma bus Hauke Mehrtens
2011-06-30  8:31   ` Florian Fainelli
2011-06-29 22:11 ` [RFC v3 13/13] bcm47xx: fix irq assignment for new SoCs Hauke Mehrtens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1309385518-12097-10-git-send-email-hauke@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=arend@broadcom.com \
    --cc=arnd@arndb.de \
    --cc=b43-dev@lists.infradead.org \
    --cc=bernhardloos@googlemail.com \
    --cc=george@znau.edu.ua \
    --cc=julian.calaby@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mb@bu3sch.de \
    --cc=sshtylyov@mvista.com \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).