@@ -654,6 +656,25 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
if (ret)
return ret;
+ /* If the EEPROM hasn't been retrieved via firmware request
+ * use the nvmem API insted.
+ */
+ if (!ah->eeprom_blob) {
+ struct nvmem_cell *eeprom_cell;
+
+ eeprom_cell = nvmem_cell_get(ah->dev, "eeprom");
+ if (!IS_ERR(eeprom_cell)) {
+ ah->eeprom_data = nvmem_cell_read(
+ eeprom_cell, &ah->eeprom_size);
+ nvmem_cell_put(eeprom_cell);
+
+ if (IS_ERR(ah->eeprom_data)) {
+ dev_err(ah->dev, "failed to read eeprom");
+ return PTR_ERR(ah->eeprom_data);
+ }
+ }
+ }
+
if (ath9k_led_active_high != -1)
ah->config.led_active_high = ath9k_led_active_high == 1;