diff options
author | Binoy Jayan | 2016-08-22 06:39:42 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2016-09-01 17:44:01 +0200 |
commit | 5c2ba8b85e350678b96db57cc8972deb9e47c497 (patch) | |
tree | 053419b13cedc5b4c9883c34375eceea59864d17 /drivers/staging/rtl8712/rtl871x_pwrctrl.h | |
parent | staging: android: ion: ion.c fix parenthesis alignment (diff) | |
download | kernel-qcow2-linux-5c2ba8b85e350678b96db57cc8972deb9e47c497.tar.gz kernel-qcow2-linux-5c2ba8b85e350678b96db57cc8972deb9e47c497.tar.xz kernel-qcow2-linux-5c2ba8b85e350678b96db57cc8972deb9e47c497.zip |
rtl8712: pwrctrl_priv: Replace semaphore lock with mutex
The semaphore 'lock' in 'pwrctrl_priv' is used as a simple mutex, so it
should be written as one. Semaphores are going away in the future.
_enter_pwrlock was using down_interruptible(), so the lock could be broken
by sending a signal. This could be a bug, because nothing checks the return
code here. Hence, using mutex_lock instead of the interruptible version.
Removing the now unused _enter_pwrlock and _down_sema.
Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8712/rtl871x_pwrctrl.h')
-rw-r--r-- | drivers/staging/rtl8712/rtl871x_pwrctrl.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h b/drivers/staging/rtl8712/rtl871x_pwrctrl.h index dbfb55523545..231445e75f93 100644 --- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h +++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h @@ -87,13 +87,8 @@ struct reportpwrstate_parm { unsigned short rsvd; }; -static inline void _enter_pwrlock(struct semaphore *plock) -{ - _down_sema(plock); -} - struct pwrctrl_priv { - struct semaphore lock; + struct mutex mutex_lock; /*volatile*/ u8 rpwm; /* requested power state for fw */ /* fw current power state. updated when 1. read from HCPWM or * 2. driver lowers power level */ |