1 --- a/drivers/net/wireless/ath/ath5k/eeprom.c
2 +++ b/drivers/net/wireless/ath/ath5k/eeprom.c
4 \*************************************/
6 #include <linux/slab.h>
7 +#include <linux/ath5k_platform.h>
8 +#include <linux/pci.h>
13 static int ath5k_hw_eeprom_read(struct ath5k_hw *ah, u32 offset, u16 *data)
16 + struct ath5k_platform_data *pdata = NULL;
18 + if (ah->ah_sc->pdev)
19 + pdata = ah->ah_sc->pdev->dev.platform_data;
21 + if (pdata && pdata->eeprom_data && pdata->eeprom_data[0] == AR5K_EEPROM_MAGIC_VALUE)
23 + ATH5K_INFO(ah->ah_sc, "using eeprom-content from platform_data\n");
24 + if (offset >= ATH5K_PLAT_EEP_MAX_WORDS) return -EIO;
25 + *data = pdata->eeprom_data[offset];
30 * Initialize EEPROM access
31 @@ -1788,7 +1802,7 @@ ath5k_eeprom_init(struct ath5k_hw *ah)
35 - * Read the MAC address from eeprom
36 + * Read the MAC address from eeprom or platform_data
38 int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
40 @@ -1796,6 +1810,16 @@ int ath5k_eeprom_read_mac(struct ath5k_h
44 + struct ath5k_platform_data *pdata = NULL;
46 + if (ah->ah_sc->pdev)
47 + pdata = ah->ah_sc->pdev->dev.platform_data;
49 + if (pdata && pdata->macaddr)
51 + memcpy(mac, pdata->macaddr, ETH_ALEN);
55 ret = ath5k_hw_eeprom_read(ah, 0x20, &data);