Root/package/mac80211/patches/302-pending-ath9k-move-duplicated-debug-message-to-ath9k_hw_nvra.patch

1From cd3d888d569f5908c4345f7c99018f574c80a32b Mon Sep 17 00:00:00 2001
2From: Gabor Juhos <juhosg@openwrt.org>
3Date: Sun, 9 Dec 2012 14:58:56 +0100
4Subject: [PATCH 1/4] ath9k: move duplicated debug message to
5 'ath9k_hw_nvram_read'
6
7The fill_eeprom functions are printing the same
8debug message in case the 'ath9k_hw_nvram_read'
9function fails. Remove the duplicated code from
10fill_eeprom functions and add the ath_dbg call
11directly into 'ath9k_hw_nvram_read'.
12
13Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
14---
15 drivers/net/wireless/ath/ath9k/eeprom.c | 8 +++++++-
16 drivers/net/wireless/ath/ath9k/eeprom_4k.c | 6 ++----
17 drivers/net/wireless/ath/ath9k/eeprom_9287.c | 5 +----
18 drivers/net/wireless/ath/ath9k/eeprom_def.c | 5 +----
19 4 files changed, 11 insertions(+), 13 deletions(-)
20
21--- a/drivers/net/wireless/ath/ath9k/eeprom.c
22+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
23@@ -115,7 +115,13 @@ void ath9k_hw_usb_gen_fill_eeprom(struct
24 
25 bool ath9k_hw_nvram_read(struct ath_common *common, u32 off, u16 *data)
26 {
27- return common->bus_ops->eeprom_read(common, off, data);
28+ bool ret;
29+
30+ ret = common->bus_ops->eeprom_read(common, off, data);
31+ if (!ret)
32+ ath_dbg(common, EEPROM, "Unable to read eeprom region\n");
33+
34+ return ret;
35 }
36 
37 void ath9k_hw_fill_vpd_table(u8 pwrMin, u8 pwrMax, u8 *pPwrList,
38--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
39+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
40@@ -37,11 +37,9 @@ static bool __ath9k_hw_4k_fill_eeprom(st
41     int addr, eep_start_loc = 64;
42 
43     for (addr = 0; addr < SIZE_EEPROM_4K; addr++) {
44- if (!ath9k_hw_nvram_read(common, addr + eep_start_loc, eep_data)) {
45- ath_dbg(common, EEPROM,
46- "Unable to read eeprom region\n");
47+ if (!ath9k_hw_nvram_read(common, addr + eep_start_loc,
48+ eep_data))
49             return false;
50- }
51         eep_data++;
52     }
53 
54--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
55+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
56@@ -40,11 +40,8 @@ static bool __ath9k_hw_ar9287_fill_eepro
57 
58     for (addr = 0; addr < SIZE_EEPROM_AR9287; addr++) {
59         if (!ath9k_hw_nvram_read(common, addr + eep_start_loc,
60- eep_data)) {
61- ath_dbg(common, EEPROM,
62- "Unable to read eeprom region\n");
63+ eep_data))
64             return false;
65- }
66         eep_data++;
67     }
68 
69--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
70+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
71@@ -97,11 +97,8 @@ static bool __ath9k_hw_def_fill_eeprom(s
72 
73     for (addr = 0; addr < SIZE_EEPROM_DEF; addr++) {
74         if (!ath9k_hw_nvram_read(common, addr + ar5416_eep_start_loc,
75- eep_data)) {
76- ath_err(ath9k_hw_common(ah),
77- "Unable to read eeprom region\n");
78+ eep_data))
79             return false;
80- }
81         eep_data++;
82     }
83     return true;
84

Archive Download this file



interactive