Skip to content

Commit

Permalink
ath9k: propagate hw initialization errors
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Aug 4, 2009
1 parent fbf5466 commit 7819ac8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 3 additions & 4 deletions drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 7819ac8

Please sign in to comment.