ath9k: move duplicated debug message to 'ath9k_hw_nvram_read'
authorGabor Juhos <juhosg@openwrt.org>
Mon, 10 Dec 2012 14:30:25 +0000 (15:30 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 10 Dec 2012 20:49:54 +0000 (15:49 -0500)
The fill_eeprom functions are printing the same
debug message in case the 'ath9k_hw_nvram_read'
function fails. Remove the duplicated code from
fill_eeprom functions and add the ath_dbg call
directly into 'ath9k_hw_nvram_read'.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/eeprom.c
drivers/net/wireless/ath/ath9k/eeprom_4k.c
drivers/net/wireless/ath/ath9k/eeprom_9287.c
drivers/net/wireless/ath/ath9k/eeprom_def.c

index 0512397a293c9a50a41cb61389f6aeb1c6da2d7a..4b6a9350adcf8512f93aa38891677bae4f899e8d 100644 (file)
@@ -115,7 +115,13 @@ void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
 
 bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data)
 {
-       return common->bus_ops->eeprom_read(common, off, data);
+       bool ret;
+
+       ret = common->bus_ops->eeprom_read(common, off, data);
+       if (!ret)
+               ath_dbg(common, EEPROM, "Unable to read eeprom region\n");
+
+       return ret;
 }
 
 void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList,
index 7d075105a85d7b0300f167ec02cb03ac85c3fad2..17c843d372101fdcd36560c39dbd352a3e3404b1 100644 (file)
@@ -37,11 +37,9 @@ static bool __ath9k_hw_4k_fill_eeprom(struct ath_hw *ah)
        int addr, eep_start_loc = 64;
 
        for (addr = 0; addr < SIZE_EEPROM_4K; addr++) {
-               if (!ath9k_hw_nvram_read(common, addr + eep_start_loc, eep_data)) {
-                       ath_dbg(common, EEPROM,
-                               "Unable to read eeprom region\n");
+               if (!ath9k_hw_nvram_read(common, addr + eep_start_loc,
+                                        eep_data))
                        return false;
-               }
                eep_data++;
        }
 
index cd742fb944c274528ee5cfce31625ba329f42b55..f2c32bc36f1c289838f9663e2a21a103ea3fdc63 100644 (file)
@@ -40,11 +40,8 @@ static bool __ath9k_hw_ar9287_fill_eeprom(struct ath_hw *ah)
 
        for (addr = 0; addr < SIZE_EEPROM_AR9287; addr++) {
                if (!ath9k_hw_nvram_read(common, addr + eep_start_loc,
-                                        eep_data)) {
-                       ath_dbg(common, EEPROM,
-                               "Unable to read eeprom region\n");
+                                        eep_data))
                        return false;
-               }
                eep_data++;
        }
 
index a8ac30a0072089a594abf849d00ff41105afa078..2654f741b8bf6d970133143837b5c5030c15edab 100644 (file)
@@ -97,11 +97,8 @@ static bool __ath9k_hw_def_fill_eeprom(struct ath_hw *ah)
 
        for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) {
                if (!ath9k_hw_nvram_read(common, addr + ar5416_eep_start_loc,
-                                        eep_data)) {
-                       ath_err(ath9k_hw_common(ah),
-                               "Unable to read eeprom region\n");
+                                        eep_data))
                        return false;
-               }
                eep_data++;
        }
        return true;