From: Binoy Jayan Date: Wed, 1 Jun 2016 09:26:54 +0000 (+0530) Subject: rtl8192e: Replace semaphore rf_sem with mutex X-Git-Tag: v4.9-rc1~119^2~926 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5333496cb01ab216ba638976846531344bc3c4b9;p=karo-tx-linux.git rtl8192e: Replace semaphore rf_sem with mutex The semaphore 'rf_sem' in the rtl8192e is a simple mutex, so it should be written as one. Semaphores are going away in the future. Signed-off-by: Binoy Jayan Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c index 0698131e4300..dde492261451 100644 --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c @@ -256,7 +256,7 @@ u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, return 0; if (priv->rtllib->eRFPowerState != eRfOn && !priv->being_init_adapter) return 0; - down(&priv->rf_sem); + mutex_lock(&priv->rf_mutex); if (priv->Rf_Mode == RF_OP_By_FW) { Original_Value = _rtl92e_phy_rf_fw_read(dev, eRFPath, RegAddr); udelay(200); @@ -265,7 +265,7 @@ u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, } BitShift = _rtl92e_calculate_bit_shift(BitMask); Readback_Value = (Original_Value & BitMask) >> BitShift; - up(&priv->rf_sem); + mutex_unlock(&priv->rf_mutex); return Readback_Value; } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 469202803d22..e01fff0b0f3c 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -994,7 +994,7 @@ static void _rtl92e_init_priv_lock(struct r8192_priv *priv) spin_lock_init(&priv->rf_ps_lock); spin_lock_init(&priv->ps_lock); mutex_init(&priv->wx_mutex); - sema_init(&priv->rf_sem, 1); + mutex_init(&priv->rf_mutex); mutex_init(&priv->mutex); } diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h index 16378e6af894..babc0b3bce95 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.h +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.h @@ -376,7 +376,7 @@ struct r8192_priv { struct tasklet_struct irq_prepare_beacon_tasklet; struct mutex wx_mutex; - struct semaphore rf_sem; + struct mutex rf_mutex; struct mutex mutex; struct rt_stats stats;