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: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220409163212.241122-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2b1795e42a
commit
11788aac92
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user