From: Jes Sorensen Date: Tue, 1 Jul 2014 08:11:14 +0000 (+0200) Subject: staging: rtl8723au: Clean up rtw_pm_set_ips23a() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c742e339d5ed554cc20f20df56ae90b553405c9c;p=openwrt%2Fstaging%2Fblogic.git staging: rtl8723au: Clean up rtw_pm_set_ips23a() Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c index 7dc7c90eba0e..ef29118ddbde 100644 --- a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c @@ -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; } diff --git a/drivers/staging/rtl8723au/include/rtw_pwrctrl.h b/drivers/staging/rtl8723au/include/rtw_pwrctrl.h index 577914dc93be..97bb569524cc 100644 --- a/drivers/staging/rtl8723au/include/rtw_pwrctrl.h +++ b/drivers/staging/rtl8723au/include/rtw_pwrctrl.h @@ -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) \