Commit 11788aac authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: r8188eu: improve timeout handling in LPS_RF_ON_check

Use the standard kernel functions to define and check the timeout in
LPS_RF_ON_check.
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220409163212.241122-8-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b1795e4
......@@ -250,10 +250,9 @@ static bool lps_rf_on(struct adapter *adapter)
*/
static s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
{
u32 start_time;
unsigned long timeout = jiffies + msecs_to_jiffies(delay_ms);
s32 err = 0;
start_time = jiffies;
while (1) {
if (lps_rf_on(padapter))
break;
......@@ -263,7 +262,7 @@ static s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
break;
}
if (rtw_get_passing_time_ms(start_time) > delay_ms) {
if (time_after(jiffies, timeout)) {
err = -1;
break;
}
......
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