Commit eb8b27ad authored by Larry Finger's avatar Larry Finger Committed by John W. Linville

rtlwifi: rtl8192de: Replace loops calling udelay with single mdelay

There are a number of loops to implement delays. These are replaced with
single calls to mdelay().

The need for a fix was noted by Andrew Morton <akpm@linux-foundation.org>.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c2a7965f
...@@ -932,7 +932,7 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, ...@@ -932,7 +932,7 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
enum rf_content content, enum rf_content content,
enum radio_path rfpath) enum radio_path rfpath)
{ {
int i, j; int i;
u32 *radioa_array_table; u32 *radioa_array_table;
u32 *radiob_array_table; u32 *radiob_array_table;
u16 radioa_arraylen, radiob_arraylen; u16 radioa_arraylen, radiob_arraylen;
...@@ -974,13 +974,10 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, ...@@ -974,13 +974,10 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
mdelay(50); mdelay(50);
} else if (radioa_array_table[i] == 0xfd) { } else if (radioa_array_table[i] == 0xfd) {
/* delay_ms(5); */ /* delay_ms(5); */
for (j = 0; j < 100; j++) mdelay(5);
udelay(MAX_STALL_TIME);
} else if (radioa_array_table[i] == 0xfc) { } else if (radioa_array_table[i] == 0xfc) {
/* delay_ms(1); */ /* delay_ms(1); */
for (j = 0; j < 20; j++) mdelay(1);
udelay(MAX_STALL_TIME);
} else if (radioa_array_table[i] == 0xfb) { } else if (radioa_array_table[i] == 0xfb) {
udelay(50); udelay(50);
} else if (radioa_array_table[i] == 0xfa) { } else if (radioa_array_table[i] == 0xfa) {
...@@ -1004,12 +1001,10 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw, ...@@ -1004,12 +1001,10 @@ bool rtl92d_phy_config_rf_with_headerfile(struct ieee80211_hw *hw,
mdelay(50); mdelay(50);
} else if (radiob_array_table[i] == 0xfd) { } else if (radiob_array_table[i] == 0xfd) {
/* delay_ms(5); */ /* delay_ms(5); */
for (j = 0; j < 100; j++) mdelay(5);
udelay(MAX_STALL_TIME);
} else if (radiob_array_table[i] == 0xfc) { } else if (radiob_array_table[i] == 0xfc) {
/* delay_ms(1); */ /* delay_ms(1); */
for (j = 0; j < 20; j++) mdelay(1);
udelay(MAX_STALL_TIME);
} else if (radiob_array_table[i] == 0xfb) { } else if (radiob_array_table[i] == 0xfb) {
udelay(50); udelay(50);
} else if (radiob_array_table[i] == 0xfa) { } else if (radiob_array_table[i] == 0xfa) {
...@@ -1276,7 +1271,7 @@ static void rtl92d_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band) ...@@ -1276,7 +1271,7 @@ static void rtl92d_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band)
{ {
struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
u8 i, value8; u8 value8;
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("==>\n")); RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("==>\n"));
rtlhal->bandset = band; rtlhal->bandset = band;
...@@ -1321,8 +1316,7 @@ static void rtl92d_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band) ...@@ -1321,8 +1316,7 @@ static void rtl92d_phy_switch_wirelessband(struct ieee80211_hw *hw, u8 band)
rtl_write_byte(rtlpriv, (rtlhal->interfaceindex == rtl_write_byte(rtlpriv, (rtlhal->interfaceindex ==
0 ? REG_MAC0 : REG_MAC1), value8); 0 ? REG_MAC0 : REG_MAC1), value8);
} }
for (i = 0; i < 20; i++) mdelay(1);
udelay(MAX_STALL_TIME);
RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("<==Switch Band OK.\n")); RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, ("<==Switch Band OK.\n"));
} }
......
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