diff options
author | Mauro Carvalho Chehab | 2017-11-14 16:47:01 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab | 2017-11-14 16:47:01 +0100 |
commit | f2ecc3d0787e05d9145722feed01d4a11ab6bec1 (patch) | |
tree | 8b952af40dad67d728f1e421efc640907c523982 /drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | |
parent | dvb_frontend: don't use-after-free the frontend struct (diff) | |
parent | staging: lustre: add SPDX identifiers to all lustre files (diff) | |
download | kernel-qcow2-linux-f2ecc3d0787e05d9145722feed01d4a11ab6bec1.tar.gz kernel-qcow2-linux-f2ecc3d0787e05d9145722feed01d4a11ab6bec1.tar.xz kernel-qcow2-linux-f2ecc3d0787e05d9145722feed01d4a11ab6bec1.zip |
Merge tag 'staging-4.15-rc1' into v4l_for_linus
There are some conflicts between staging and media trees,
as reported by Stephen Rothwell <sfr@canb.auug.org.au>.
So, merge from staging.
* tag 'staging-4.15-rc1': (775 commits)
staging: lustre: add SPDX identifiers to all lustre files
staging: greybus: Remove redundant license text
staging: greybus: add SPDX identifiers to all greybus driver files
staging: ccree: simplify ioread/iowrite
staging: ccree: simplify registers access
staging: ccree: simplify error handling logic
staging: ccree: remove dead code
staging: ccree: handle limiting of DMA masks
staging: ccree: copy IV to DMAable memory
staging: fbtft: remove redundant initialization of buf
staging: sm750fb: Fix parameter mistake in poke32
staging: wilc1000: Fix bssid buffer offset in Txq
staging: fbtft: fb_ssd1331: fix mirrored display
staging: android: Fix checkpatch.pl error
staging: greybus: loopback: convert loopback to use generic async operations
staging: greybus: operation: add private data with get/set accessors
staging: greybus: loopback: Fix iteration count on async path
staging: greybus: loopback: Hold per-connection mutex across operations
staging: greybus/loopback: use ktime_get() for time intervals
staging: fsl-dpaa2/eth: Extra headroom in RX buffers
...
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/staging/rtl8188eu/core/rtw_pwrctrl.c')
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c index f86c9cebf09a..ac27f9a023bc 100644 --- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c @@ -37,7 +37,7 @@ static int rtw_hw_suspend(struct adapter *padapter) /* system suspend */ LeaveAllPowerSaveMode(padapter); - DBG_88E("==> rtw_hw_suspend\n"); + DBG_88E("==> %s\n", __func__); mutex_lock(&pwrpriv->mutex_lock); pwrpriv->bips_processing = true; /* s1. */ @@ -89,7 +89,7 @@ static int rtw_hw_resume(struct adapter *padapter) /* system resume */ - DBG_88E("==> rtw_hw_resume\n"); + DBG_88E("==> %s\n", __func__); mutex_lock(&pwrpriv->mutex_lock); pwrpriv->bips_processing = true; rtw_reset_drv_sw(padapter); @@ -146,7 +146,7 @@ void ips_enter(struct adapter *padapter) pwrpriv->ips_mode = pwrpriv->ips_mode_req; pwrpriv->ips_enter_cnts++; - DBG_88E("==>ips_enter cnts:%d\n", pwrpriv->ips_enter_cnts); + DBG_88E("==>%s:%d\n", __func__, pwrpriv->ips_enter_cnts); if (rf_off == pwrpriv->change_rfpwrstate) { pwrpriv->bpower_saving = true; DBG_88E_LEVEL(_drv_info_, "nolinked power save enter\n"); @@ -177,7 +177,7 @@ int ips_leave(struct adapter *padapter) pwrpriv->bips_processing = true; pwrpriv->change_rfpwrstate = rf_on; pwrpriv->ips_leave_cnts++; - DBG_88E("==>ips_leave cnts:%d\n", pwrpriv->ips_leave_cnts); + DBG_88E("==>%s:%d\n", __func__, pwrpriv->ips_leave_cnts); result = rtw_ips_pwr_up(padapter); if (result == _SUCCESS) @@ -198,7 +198,7 @@ int ips_leave(struct adapter *padapter) } } - DBG_88E("==> ips_leave.....LED(0x%08x)...\n", usb_read32(padapter, 0x4c)); + DBG_88E("==> %s.....LED(0x%08x)...\n", __func__, usb_read32(padapter, 0x4c)); pwrpriv->bips_processing = false; pwrpriv->bkeepfwalive = false; @@ -276,9 +276,11 @@ exit: pwrpriv->ps_processing = false; } -static void pwr_state_check_handler(unsigned long data) +static void pwr_state_check_handler(struct timer_list *t) { - struct adapter *padapter = (struct adapter *)data; + struct adapter *padapter = + from_timer(padapter, t, + pwrctrlpriv.pwr_state_check_timer); rtw_ps_cmd(padapter); } @@ -332,7 +334,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv) rpwm = pslv | pwrpriv->tog; RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_, - ("rtw_set_rpwm: rpwm=0x%02x cpwm=0x%02x\n", rpwm, pwrpriv->cpwm)); + ("%s: rpwm=0x%02x cpwm=0x%02x\n", __func__, rpwm, pwrpriv->cpwm)); pwrpriv->rpwm = pslv; @@ -525,7 +527,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) pwrctrlpriv->power_mgnt = PS_MODE_ACTIVE; else pwrctrlpriv->power_mgnt = padapter->registrypriv.power_mgnt;/* PS_MODE_MIN; */ - pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt) ? true : false; + pwrctrlpriv->bLeisurePs = (pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE) ? true : false; pwrctrlpriv->bFwCurrentInPSMode = false; @@ -540,9 +542,8 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) pwrctrlpriv->btcoex_rfon = false; - setup_timer(&pwrctrlpriv->pwr_state_check_timer, - pwr_state_check_handler, - (unsigned long)padapter); + timer_setup(&pwrctrlpriv->pwr_state_check_timer, + pwr_state_check_handler, 0); } /* @@ -569,7 +570,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal DBG_88E("%s wait ps_processing...\n", __func__); while (pwrpriv->ps_processing && jiffies_to_msecs(jiffies - start) <= 3000) - usleep_range(1000, 3000); + udelay(1500); if (pwrpriv->ps_processing) DBG_88E("%s wait ps_processing timeout\n", __func__); else @@ -595,7 +596,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal } if (rf_off == pwrpriv->rf_pwrstate) { DBG_88E("%s call ips_leave....\n", __func__); - if (_FAIL == ips_leave(padapter)) { + if (ips_leave(padapter) == _FAIL) { DBG_88E("======> ips_leave fail.............\n"); ret = _FAIL; goto exit; @@ -628,12 +629,12 @@ int rtw_pm_set_lps(struct adapter *padapter, u8 mode) if (mode < PS_MODE_NUM) { if (pwrctrlpriv->power_mgnt != mode) { - if (PS_MODE_ACTIVE == mode) + if (mode == PS_MODE_ACTIVE) LeaveAllPowerSaveMode(padapter); else pwrctrlpriv->LpsIdleCount = 2; pwrctrlpriv->power_mgnt = mode; - pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt) ? true : false; + pwrctrlpriv->bLeisurePs = (pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE) ? true : false; } } else { ret = -EINVAL; @@ -653,7 +654,7 @@ int rtw_pm_set_ips(struct adapter *padapter, u8 mode) } else if (mode == IPS_NONE) { rtw_ips_mode_req(pwrctrlpriv, mode); DBG_88E("%s %s\n", __func__, "IPS_NONE"); - if ((padapter->bSurpriseRemoved == 0) && (_FAIL == rtw_pwr_wakeup(padapter))) + if ((padapter->bSurpriseRemoved == 0) && (rtw_pwr_wakeup(padapter) == _FAIL)) return -EFAULT; } else { return -EINVAL; |