Commit 85efc86e authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville
Browse files

atheros: fix propagation of bad EEPROM on regulatory init

When the EEPROM is not in good condition we cannot continue so
we currently bail out but only ath5k is bailing out properly.
Both ath9k and ar9170 were proceeding and if a user were to run
into this they'd see an obscure panic. Lets propagate the error
as intended and make sure we inform the user by lifting the
error message from debug to a kernel error.

Stable note: You can find a port of this page here:

Signed-off-by: default avatarLuis R. Rodriguez <>
Signed-off-by: default avatarJohn W. Linville <>
parent 26925042
......@@ -1649,6 +1649,8 @@ int ar9170_register(struct ar9170 *ar, struct device *pdev)
err = ath_regd_init(&ar->regulatory, ar->hw->wiphy,
if (err)
goto err_out;
err = ieee80211_register_hw(ar->hw);
if (err)
......@@ -1416,8 +1416,9 @@ static int ath_init(u16 devid, struct ath_softc *sc)
for (i = 0; i < sc->keymax; i++)
ath9k_hw_keyreset(ah, (u16) i);
if (ath_regd_init(&sc->sc_ah->regulatory, sc->hw->wiphy,
error = ath_regd_init(&sc->sc_ah->regulatory, sc->hw->wiphy,
if (error)
goto bad;
/* default to MONITOR mode */
......@@ -477,7 +477,7 @@ ath_regd_init(struct ath_regulatory *reg,
u16 regdmn;
if (!ath_regd_is_eeprom_valid(reg)) {
printk(KERN_DEBUG "ath: Invalid EEPROM contents\n");
printk(KERN_ERR "ath: Invalid EEPROM contents\n");
return -EINVAL;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment