aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorWojciech Dubowik <dubowoj@neratec.com>2011-01-11 03:00:31 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-19 11:36:08 -0500
commitfda9b7afa70f9003853929821748aec98d567b1e (patch)
tree168d1a800bc53c63bd59e1f780a66852502247c2 /drivers/net/wireless
parent8b3f4616d40a2ad19dd14af40b73f56860c812ea (diff)
ath5k: Fix return codes for eeprom read functions.
Eeprom read functions are of bool type and not int. Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath5k/ahb.c7
-rw-r--r--drivers/net/wireless/ath/ath5k/eeprom.c24
-rw-r--r--drivers/net/wireless/ath/ath5k/eeprom.h5
-rw-r--r--drivers/net/wireless/ath/ath5k/pci.c9
4 files changed, 19 insertions, 26 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
index 707cde149248..ae84b86c3bf2 100644
--- a/drivers/net/wireless/ath/ath5k/ahb.c
+++ b/drivers/net/wireless/ath/ath5k/ahb.c
@@ -31,7 +31,8 @@ static void ath5k_ahb_read_cachesize(struct ath_common *common, int *csz)
31 *csz = L1_CACHE_BYTES >> 2; 31 *csz = L1_CACHE_BYTES >> 2;
32} 32}
33 33
34bool ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data) 34static bool
35ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
35{ 36{
36 struct ath5k_softc *sc = common->priv; 37 struct ath5k_softc *sc = common->priv;
37 struct platform_device *pdev = to_platform_device(sc->dev); 38 struct platform_device *pdev = to_platform_device(sc->dev);
@@ -46,10 +47,10 @@ bool ath5k_ahb_eeprom_read(struct ath_common *common, u32 off, u16 *data)
46 47
47 eeprom += off; 48 eeprom += off;
48 if (eeprom > eeprom_end) 49 if (eeprom > eeprom_end)
49 return -EINVAL; 50 return false;
50 51
51 *data = *eeprom; 52 *data = *eeprom;
52 return 0; 53 return true;
53} 54}
54 55
55int ath5k_hw_read_srev(struct ath5k_hw *ah) 56int ath5k_hw_read_srev(struct ath5k_hw *ah)
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c
index 80e625608bac..b6561f785c6e 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
@@ -72,7 +72,6 @@ static int
72ath5k_eeprom_init_header(struct ath5k_hw *ah) 72ath5k_eeprom_init_header(struct ath5k_hw *ah)
73{ 73{
74 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; 74 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
75 int ret;
76 u16 val; 75 u16 val;
77 u32 cksum, offset, eep_max = AR5K_EEPROM_INFO_MAX; 76 u32 cksum, offset, eep_max = AR5K_EEPROM_INFO_MAX;
78 77
@@ -192,7 +191,7 @@ static int ath5k_eeprom_read_ants(struct ath5k_hw *ah, u32 *offset,
192 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; 191 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
193 u32 o = *offset; 192 u32 o = *offset;
194 u16 val; 193 u16 val;
195 int ret, i = 0; 194 int i = 0;
196 195
197 AR5K_EEPROM_READ(o++, val); 196 AR5K_EEPROM_READ(o++, val);
198 ee->ee_switch_settling[mode] = (val >> 8) & 0x7f; 197 ee->ee_switch_settling[mode] = (val >> 8) & 0x7f;
@@ -252,7 +251,6 @@ static int ath5k_eeprom_read_modes(struct ath5k_hw *ah, u32 *offset,
252 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; 251 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
253 u32 o = *offset; 252 u32 o = *offset;
254 u16 val; 253 u16 val;
255 int ret;
256 254
257 ee->ee_n_piers[mode] = 0; 255 ee->ee_n_piers[mode] = 0;
258 AR5K_EEPROM_READ(o++, val); 256 AR5K_EEPROM_READ(o++, val);
@@ -515,7 +513,6 @@ ath5k_eeprom_read_freq_list(struct ath5k_hw *ah, int *offset, int max,
515 int o = *offset; 513 int o = *offset;
516 int i = 0; 514 int i = 0;
517 u8 freq1, freq2; 515 u8 freq1, freq2;
518 int ret;
519 u16 val; 516 u16 val;
520 517
521 ee->ee_n_piers[mode] = 0; 518 ee->ee_n_piers[mode] = 0;
@@ -551,7 +548,7 @@ ath5k_eeprom_init_11a_pcal_freq(struct ath5k_hw *ah, int offset)
551{ 548{
552 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom; 549 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
553 struct ath5k_chan_pcal_info *pcal = ee->ee_pwr_cal_a; 550 struct ath5k_chan_pcal_info *pcal = ee->ee_pwr_cal_a;
554 int i, ret; 551 int i;
555 u16 val; 552 u16 val;
556 u8 mask; 553 u8 mask;
557 554
@@ -970,7 +967,6 @@ ath5k_eeprom_read_pcal_info_5112(struct ath5k_hw *ah, int mode)
970 u32 offset; 967 u32 offset;
971 u8 i, c; 968 u8 i, c;
972 u16 val; 969 u16 val;
973 int ret;
974 u8 pd_gains = 0; 970 u8 pd_gains = 0;
975 971
976 /* Count how many curves we have and 972 /* Count how many curves we have and
@@ -1228,7 +1224,7 @@ ath5k_eeprom_read_pcal_info_2413(struct ath5k_hw *ah, int mode)
1228 struct ath5k_chan_pcal_info *chinfo; 1224 struct ath5k_chan_pcal_info *chinfo;
1229 u8 *pdgain_idx = ee->ee_pdc_to_idx[mode]; 1225 u8 *pdgain_idx = ee->ee_pdc_to_idx[mode];
1230 u32 offset; 1226 u32 offset;
1231 int idx, i, ret; 1227 int idx, i;
1232 u16 val; 1228 u16 val;
1233 u8 pd_gains = 0; 1229 u8 pd_gains = 0;
1234 1230
@@ -1419,7 +1415,7 @@ ath5k_eeprom_read_target_rate_pwr_info(struct ath5k_hw *ah, unsigned int mode)
1419 u8 *rate_target_pwr_num; 1415 u8 *rate_target_pwr_num;
1420 u32 offset; 1416 u32 offset;
1421 u16 val; 1417 u16 val;
1422 int ret, i; 1418 int i;
1423 1419
1424 offset = AR5K_EEPROM_TARGET_PWRSTART(ee->ee_misc1); 1420 offset = AR5K_EEPROM_TARGET_PWRSTART(ee->ee_misc1);
1425 rate_target_pwr_num = &ee->ee_rate_target_pwr_num[mode]; 1421 rate_target_pwr_num = &ee->ee_rate_target_pwr_num[mode];
@@ -1593,7 +1589,7 @@ ath5k_eeprom_read_ctl_info(struct ath5k_hw *ah)
1593 struct ath5k_edge_power *rep; 1589 struct ath5k_edge_power *rep;
1594 unsigned int fmask, pmask; 1590 unsigned int fmask, pmask;
1595 unsigned int ctl_mode; 1591 unsigned int ctl_mode;
1596 int ret, i, j; 1592 int i, j;
1597 u32 offset; 1593 u32 offset;
1598 u16 val; 1594 u16 val;
1599 1595
@@ -1733,16 +1729,12 @@ int ath5k_eeprom_read_mac(struct ath5k_hw *ah, u8 *mac)
1733 u8 mac_d[ETH_ALEN] = {}; 1729 u8 mac_d[ETH_ALEN] = {};
1734 u32 total, offset; 1730 u32 total, offset;
1735 u16 data; 1731 u16 data;
1736 int octet, ret; 1732 int octet;
1737 1733
1738 ret = ath5k_hw_nvram_read(ah, 0x20, &data); 1734 AR5K_EEPROM_READ(0x20, data);
1739 if (ret)
1740 return ret;
1741 1735
1742 for (offset = 0x1f, octet = 0, total = 0; offset >= 0x1d; offset--) { 1736 for (offset = 0x1f, octet = 0, total = 0; offset >= 0x1d; offset--) {
1743 ret = ath5k_hw_nvram_read(ah, offset, &data); 1737 AR5K_EEPROM_READ(offset, data);
1744 if (ret)
1745 return ret;
1746 1738
1747 total += data; 1739 total += data;
1748 mac_d[octet + 1] = data & 0xff; 1740 mac_d[octet + 1] = data & 0xff;
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.h b/drivers/net/wireless/ath/ath5k/eeprom.h
index 7c09e150dbdc..d46f1056f447 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.h
+++ b/drivers/net/wireless/ath/ath5k/eeprom.h
@@ -241,9 +241,8 @@ enum ath5k_eeprom_freq_bands{
241#define AR5K_SPUR_SYMBOL_WIDTH_TURBO_100Hz 6250 241#define AR5K_SPUR_SYMBOL_WIDTH_TURBO_100Hz 6250
242 242
243#define AR5K_EEPROM_READ(_o, _v) do { \ 243#define AR5K_EEPROM_READ(_o, _v) do { \
244 ret = ath5k_hw_nvram_read(ah, (_o), &(_v)); \ 244 if (!ath5k_hw_nvram_read(ah, (_o), &(_v))) \
245 if (ret) \ 245 return -EIO; \
246 return ret; \
247} while (0) 246} while (0)
248 247
249#define AR5K_EEPROM_READ_HDR(_o, _v) \ 248#define AR5K_EEPROM_READ_HDR(_o, _v) \
diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
index 7f8c5b0e9d2a..66598a0d1df0 100644
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ b/drivers/net/wireless/ath/ath5k/pci.c
@@ -69,7 +69,8 @@ static void ath5k_pci_read_cachesize(struct ath_common *common, int *csz)
69/* 69/*
70 * Read from eeprom 70 * Read from eeprom
71 */ 71 */
72bool ath5k_pci_eeprom_read(struct ath_common *common, u32 offset, u16 *data) 72static bool
73ath5k_pci_eeprom_read(struct ath_common *common, u32 offset, u16 *data)
73{ 74{
74 struct ath5k_hw *ah = (struct ath5k_hw *) common->ah; 75 struct ath5k_hw *ah = (struct ath5k_hw *) common->ah;
75 u32 status, timeout; 76 u32 status, timeout;
@@ -90,15 +91,15 @@ bool ath5k_pci_eeprom_read(struct ath_common *common, u32 offset, u16 *data)
90 status = ath5k_hw_reg_read(ah, AR5K_EEPROM_STATUS); 91 status = ath5k_hw_reg_read(ah, AR5K_EEPROM_STATUS);
91 if (status & AR5K_EEPROM_STAT_RDDONE) { 92 if (status & AR5K_EEPROM_STAT_RDDONE) {
92 if (status & AR5K_EEPROM_STAT_RDERR) 93 if (status & AR5K_EEPROM_STAT_RDERR)
93 return -EIO; 94 return false;
94 *data = (u16)(ath5k_hw_reg_read(ah, AR5K_EEPROM_DATA) & 95 *data = (u16)(ath5k_hw_reg_read(ah, AR5K_EEPROM_DATA) &
95 0xffff); 96 0xffff);
96 return 0; 97 return true;
97 } 98 }
98 udelay(15); 99 udelay(15);
99 } 100 }
100 101
101 return -ETIMEDOUT; 102 return false;
102} 103}
103 104
104int ath5k_hw_read_srev(struct ath5k_hw *ah) 105int ath5k_hw_read_srev(struct ath5k_hw *ah)