staging: r8188eu: internal autosuspend is always false
authorMartin Kaiser <martin@kaiser.cx>
Sun, 2 Jan 2022 17:59:29 +0000 (18:59 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Jan 2022 13:31:20 +0000 (14:31 +0100)
bInternalAutoSuspend is always false. Remove the variable and related
checks.

Acked-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220102175932.89127-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/core/rtw_pwrctrl.c
drivers/staging/r8188eu/include/rtw_pwrctrl.h
drivers/staging/r8188eu/os_dep/os_intfs.c
drivers/staging/r8188eu/os_dep/usb_intf.c

index 7fa4516af6ecdaaeaf6c37f6fe978028a459c5a3..46e44aee587f0b0c2144dd83bb46800eeb285baf 100644 (file)
@@ -351,7 +351,6 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
 
        pwrctrlpriv->pwr_state_check_interval = RTW_PWR_STATE_CHK_INTERVAL;
        pwrctrlpriv->pwr_state_check_cnts = 0;
-       pwrctrlpriv->bInternalAutoSuspend = false;
        pwrctrlpriv->bInSuspend = false;
        pwrctrlpriv->bkeepfwalive = false;
 
@@ -396,7 +395,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
        }
 
        /* System suspend is not allowed to wakeup */
-       if ((!pwrpriv->bInternalAutoSuspend) && pwrpriv->bInSuspend) {
+       if (pwrpriv->bInSuspend) {
                while (pwrpriv->bInSuspend &&
                       (rtw_get_passing_time_ms(start) <= 3000 ||
                       (rtw_get_passing_time_ms(start) <= 500)))
@@ -407,12 +406,6 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
                        DBG_88E("%s wait bInSuspend done\n", __func__);
        }
 
-       /* block??? */
-       if ((pwrpriv->bInternalAutoSuspend)  && (padapter->net_closed)) {
-               ret = _FAIL;
-               goto exit;
-       }
-
        /* I think this should be check in IPS, LPS, autosuspend functions... */
        if (check_fwstate(pmlmepriv, _FW_LINKED)) {
                ret = _SUCCESS;
index 40032447355d8e8ed38395f7690244fd3a8b93dd..2d5298373d74022ee1a02b6992afbe292192e86e 100644 (file)
@@ -75,7 +75,6 @@ struct pwrctrl_priv {
        s32             pnp_current_pwr_state;
        u8              pnp_bstop_trx;
 
-       u8              bInternalAutoSuspend;
        u8              bInSuspend;
        u8              bSupportRemoteWakeup;
        struct timer_list pwr_state_check_timer;
index f81e26785d664b74ecc4b589c1f341c2685cc93a..b65e44f97826366baa04ab9dfd159ba9b3b0bb23 100644 (file)
@@ -760,10 +760,6 @@ int netdev_close(struct net_device *pnetdev)
        struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
        struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
 
-       if (padapter->pwrctrlpriv.bInternalAutoSuspend) {
-               if (padapter->pwrctrlpriv.rf_pwrstate == rf_off)
-                       padapter->pwrctrlpriv.ps_flag = true;
-       }
        padapter->net_closed = true;
 
        if (padapter->pwrctrlpriv.rf_pwrstate == rf_on) {
index 5c1faf01cb51c5e7757f61fba15a81e2620a2699..91792dfd3bbe42959b0e20c9e6a726dc9cc91b19 100644 (file)
@@ -192,8 +192,7 @@ static void rtw_dev_unload(struct adapter *padapter)
                if (padapter->intf_stop)
                        padapter->intf_stop(padapter);
                /* s4. */
-               if (!padapter->pwrctrlpriv.bInternalAutoSuspend)
-                       rtw_stop_drv_threads(padapter);
+               rtw_stop_drv_threads(padapter);
 
                /* s5. */
                if (!padapter->bSurpriseRemoved) {