Commit 3b9d0da6 authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: r8188eu: use kernel functions for timeout handling

Use the kernel functions to set a timeout and to check if it's expired.
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220413193654.258507-6-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 294e69c6
......@@ -372,8 +372,8 @@ int rtw_pwr_wakeup(struct adapter *padapter)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
unsigned long timeout = jiffies + msecs_to_jiffies(3000);
int ret = _SUCCESS;
u32 start = jiffies;
u32 ips_deffer_ms;
/* the ms will prevent from falling into IPS after wakeup */
......@@ -382,11 +382,11 @@ int rtw_pwr_wakeup(struct adapter *padapter)
if (pwrpriv->ips_deny_time < jiffies + rtw_ms_to_systime(ips_deffer_ms))
pwrpriv->ips_deny_time = jiffies + rtw_ms_to_systime(ips_deffer_ms);
while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000)
while (pwrpriv->ps_processing && time_before(jiffies, timeout))
msleep(10);
/* System suspend is not allowed to wakeup */
while (pwrpriv->bInSuspend && rtw_get_passing_time_ms(start) <= 3000)
while (pwrpriv->bInSuspend && time_before(jiffies, timeout))
msleep(10);
/* I think this should be check in IPS, LPS, autosuspend functions... */
......
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