staging: rtl8723au: Clean up rtw_pm_set_ips23a()
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 1 Jul 2014 08:11:14 +0000 (10:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Jul 2014 22:51:37 +0000 (15:51 -0700)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/core/rtw_pwrctrl.c
drivers/staging/rtl8723au/include/rtw_pwrctrl.h

index 7dc7c90eba0ea727e049b508b998355308b614b3..ef29118ddbde0c73025eed1887abb7e3460c5890 100644 (file)
@@ -615,19 +615,16 @@ int rtw_pm_set_ips23a(struct rtw_adapter *padapter, u8 mode)
 {
        struct pwrctrl_priv *pwrctrlpriv = &padapter->pwrctrlpriv;
 
-       if (mode == IPS_NORMAL || mode == IPS_LEVEL_2) {
-               rtw_ips_mode_req(pwrctrlpriv, mode);
-               DBG_8723A("%s %s\n", __func__,
-                         mode == IPS_NORMAL?"IPS_NORMAL":"IPS_LEVEL_2");
-               return 0;
-       } else if (mode == IPS_NONE) {
-               rtw_ips_mode_req(pwrctrlpriv, mode);
+       if (mode != IPS_NORMAL && mode != IPS_LEVEL_2 && mode != IPS_NONE)
+               return -EINVAL;
+
+       pwrctrlpriv->ips_mode_req = mode;
+       if (mode == IPS_NONE) {
                DBG_8723A("%s %s\n", __func__, "IPS_NONE");
                if (padapter->bSurpriseRemoved == 0 &&
                    rtw_pwr_wakeup(padapter) == _FAIL)
                        return -EFAULT;
-       } else
-               return -EINVAL;
+       }
 
        return 0;
 }
index 577914dc93be5071f0c109d7874620405e7ae04a..97bb569524cc920dadaf18cc98c4a1b7da039758 100644 (file)
@@ -214,12 +214,6 @@ struct pwrctrl_priv {
        unsigned long PS_BBRegBackup[PSBBREG_TOTALCNT];
 };
 
-#define rtw_get_ips_mode_req(pwrctrlpriv) \
-       ((pwrctrlpriv)->ips_mode_req)
-
-#define rtw_ips_mode_req(pwrctrlpriv, ips_mode) \
-       ((pwrctrlpriv)->ips_mode_req = (ips_mode))
-
 #define RTW_PWR_STATE_CHK_INTERVAL 2000
 
 #define _rtw_set_pwr_state_check_timer(pwrctrlpriv, ms) \