Commit cb7cca3a authored by Mateusz Kulikowski's avatar Mateusz Kulikowski Committed by Greg Kroah-Hartman

staging: rtl8192e: Drop large switch in rtl92e_config_rf

The same steps were made for each RF path independently.
Signed-off-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 976a06cc
...@@ -122,70 +122,19 @@ bool rtl92e_config_rf(struct net_device *dev) ...@@ -122,70 +122,19 @@ bool rtl92e_config_rf(struct net_device *dev)
RetryTimes = ConstRetryTimes; RetryTimes = ConstRetryTimes;
RF3_Final_Value = 0; RF3_Final_Value = 0;
switch (eRFPath) { while (RF3_Final_Value != RegValueToBeCheck &&
case RF90_PATH_A: RetryTimes != 0) {
while (RF3_Final_Value != RegValueToBeCheck && ret = rtl92e_config_rf_path(dev,
RetryTimes != 0) {
ret = rtl92e_config_rf_path(dev,
(enum rf90_radio_path)eRFPath);
RF3_Final_Value = rtl92e_get_rf_reg(dev,
(enum rf90_radio_path)eRFPath,
RegOffSetToBeCheck,
bMask12Bits);
RT_TRACE(COMP_RF,
"RF %d %d register final value: %x\n",
eRFPath, RegOffSetToBeCheck,
RF3_Final_Value);
RetryTimes--;
}
break;
case RF90_PATH_B:
while (RF3_Final_Value != RegValueToBeCheck &&
RetryTimes != 0) {
ret = rtl92e_config_rf_path(dev,
(enum rf90_radio_path)eRFPath); (enum rf90_radio_path)eRFPath);
RF3_Final_Value = rtl92e_get_rf_reg(dev, RF3_Final_Value = rtl92e_get_rf_reg(dev,
(enum rf90_radio_path)eRFPath,
RegOffSetToBeCheck,
bMask12Bits);
RT_TRACE(COMP_RF,
"RF %d %d register final value: %x\n",
eRFPath, RegOffSetToBeCheck,
RF3_Final_Value);
RetryTimes--;
}
break;
case RF90_PATH_C:
while (RF3_Final_Value != RegValueToBeCheck &&
RetryTimes != 0) {
ret = rtl92e_config_rf_path(dev,
(enum rf90_radio_path)eRFPath);
RF3_Final_Value = rtl92e_get_rf_reg(dev,
(enum rf90_radio_path)eRFPath, (enum rf90_radio_path)eRFPath,
RegOffSetToBeCheck, RegOffSetToBeCheck,
bMask12Bits); bMask12Bits);
RT_TRACE(COMP_RF, RT_TRACE(COMP_RF,
"RF %d %d register final value: %x\n", "RF %d %d register final value: %x\n",
eRFPath, RegOffSetToBeCheck, eRFPath, RegOffSetToBeCheck,
RF3_Final_Value); RF3_Final_Value);
RetryTimes--; RetryTimes--;
}
break;
case RF90_PATH_D:
while (RF3_Final_Value != RegValueToBeCheck &&
RetryTimes != 0) {
ret = rtl92e_config_rf_path(dev,
(enum rf90_radio_path)eRFPath);
RF3_Final_Value = rtl92e_get_rf_reg(dev,
(enum rf90_radio_path)eRFPath,
RegOffSetToBeCheck, bMask12Bits);
RT_TRACE(COMP_RF,
"RF %d %d register final value: %x\n",
eRFPath, RegOffSetToBeCheck,
RF3_Final_Value);
RetryTimes--;
}
break;
} }
switch (eRFPath) { switch (eRFPath) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment