linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: <linville@tuxdriver.com>
Cc: <linux-wireless@vger.kernel.org>, <ath9k-devel@lists.ath9k.org>,
	"Luis R. Rodriguez" <lrodriguez@atheros.com>
Subject: [PATCH 03/24] ath9k: propagate hw initialization errors
Date: Mon, 3 Aug 2009 12:24:35 -0700	[thread overview]
Message-ID: <1249327496-24629-4-git-send-email-lrodriguez@atheros.com> (raw)
In-Reply-To: <1249327496-24629-1-git-send-email-lrodriguez@atheros.com>

We were never propagating hw initialization errors, lets
do that now and also use -EOPNOTSUPP when device revision is
not supported yet.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 drivers/net/wireless/ath/ath9k/hw.c   |    2 +-
 drivers/net/wireless/ath/ath9k/main.c |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 8228f41..2e09204 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1223,7 +1223,7 @@ struct ath_hw *ath9k_hw_attach(u16 devid, struct ath_softc *sc, int *error)
 		ah = ath9k_hw_do_attach(devid, sc, error);
 		break;
 	default:
-		*error = -ENXIO;
+		*error = -EOPNOTSUPP;
 		break;
 	}
 
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 292ac2b..ada5fef 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1295,7 +1295,6 @@ static int ath9k_reg_notifier(struct wiphy *wiphy,
 static int ath_init(u16 devid, struct ath_softc *sc)
 {
 	struct ath_hw *ah = NULL;
-	int status;
 	int error = 0, i;
 	int csz = 0;
 
@@ -1323,11 +1322,11 @@ static int ath_init(u16 devid, struct ath_softc *sc)
 	/* XXX assert csz is non-zero */
 	sc->cachelsz = csz << 2;	/* convert to bytes */
 
-	ah = ath9k_hw_attach(devid, sc, &status);
+	ah = ath9k_hw_attach(devid, sc, &error);
 	if (ah == NULL) {
 		DPRINTF(sc, ATH_DBG_FATAL,
-			"Unable to attach hardware; HAL status %d\n", status);
-		error = -ENXIO;
+			"Unable to attach hardware; "
+			"initialization status: %d\n", error);
 		goto bad;
 	}
 	sc->sc_ah = ah;
-- 
1.6.3.3


  parent reply	other threads:[~2009-08-03 19:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-03 19:24 [PATCH 00/24] ath9k: hw initiazliation cleanup Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 01/24] ath9k: remove usage of AR_SREV_*() wrapper to detect supported hw Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 02/24] ath9k: use a switch for revising supported hw mac revisions Luis R. Rodriguez
2009-08-03 19:24 ` Luis R. Rodriguez [this message]
2009-08-03 19:24 ` [PATCH 04/24] ath9k: move memory allocation of ath_hw to ath_init() Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 05/24] ath9k: move devid cache setting " Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 06/24] ath9k: move cache setting of softc ah prior to attach Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 07/24] ath9k: call hw initializer directly Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 09/24] ath9k: move hw macrevision checker to helper Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 10/24] ath9k: rename ath9k_hw_newstate() to ath9k_hw_init_defaults() Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 11/24] ath9k: rename ath9k_hw_set_defaults() to ath9k_hw_init_config() Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 12/24] ath9k: remove debug message for no memoery on ath_init() Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 13/24] ath9k: break up hw initialization into a few more helpers Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 14/24] ath9k: describe hw initialization better Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 15/24] ath9k: distinguish between device initialization and ath_softc init Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 16/24] ath9k: remove !NULL check before kfree() Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 17/24] ath9k: use helper macro to kfree and nullify on ath9k_hw_rfdetach() Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 18/24] ath9k: rename ath9k_hw_rfdetach() to ath9k_hw_rf_free() Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 19/24] ath9k: rename ath9k_hw_ani_detach() to ath9k_hw_ani_disable() Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 20/24] ath9k: set ah to null after freeing Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 21/24] ath9k: set sc->sc_ah to NULL after freeing it Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 22/24] ath9k: call ath9k_hw_detach() once upon hw init failure Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 23/24] ath9k: remove dangling error check on keycache reset on hw init Luis R. Rodriguez
2009-08-03 19:24 ` [PATCH 24/24] ath9k: remove spurious check for channel on keycache reset Luis R. Rodriguez

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=1249327496-24629-4-git-send-email-lrodriguez@atheros.com \
    --to=lrodriguez@atheros.com \
    --cc=ath9k-devel@lists.ath9k.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).