Commit 38bee763 authored by Binoy Jayan's avatar Binoy Jayan Committed by Greg Kroah-Hartman

rtl8192e: Replace semaphore ips_sem with mutex

The semaphore 'ips_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: default avatarBinoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent be10ceea
......@@ -107,9 +107,9 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
__func__);
return;
}
down(&priv->rtllib->ips_sem);
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
up(&priv->rtllib->ips_sem);
mutex_unlock(&priv->rtllib->ips_mutex);
}
}
priv->rtllib->is_set_key = true;
......
......@@ -179,9 +179,9 @@ void rtl92e_ips_leave_wq(void *data)
struct net_device *dev = ieee->dev;
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
down(&priv->rtllib->ips_sem);
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
up(&priv->rtllib->ips_sem);
mutex_unlock(&priv->rtllib->ips_mutex);
}
void rtl92e_rtllib_ips_leave_wq(struct net_device *dev)
......@@ -209,9 +209,9 @@ void rtl92e_rtllib_ips_leave(struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
down(&priv->rtllib->ips_sem);
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
up(&priv->rtllib->ips_sem);
mutex_unlock(&priv->rtllib->ips_mutex);
}
static bool _rtl92e_ps_set_mode(struct net_device *dev, u8 rtPsMode)
......
......@@ -281,9 +281,9 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
netdev_info(dev,
"=========>%s(): rtl92e_ips_leave\n",
__func__);
down(&priv->rtllib->ips_sem);
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
up(&priv->rtllib->ips_sem);
mutex_unlock(&priv->rtllib->ips_mutex);
}
}
}
......@@ -442,9 +442,9 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
RT_TRACE(COMP_PS,
"=========>%s(): rtl92e_ips_leave\n",
__func__);
down(&priv->rtllib->ips_sem);
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
up(&priv->rtllib->ips_sem);
mutex_unlock(&priv->rtllib->ips_mutex);
}
}
rtllib_stop_scan(priv->rtllib);
......@@ -698,9 +698,9 @@ static int _rtl92e_wx_set_enc(struct net_device *dev,
return -ENETDOWN;
priv->rtllib->wx_set_enc = 1;
down(&priv->rtllib->ips_sem);
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
up(&priv->rtllib->ips_sem);
mutex_unlock(&priv->rtllib->ips_mutex);
mutex_lock(&priv->wx_mutex);
RT_TRACE(COMP_SEC, "Setting SW wep key");
......@@ -905,9 +905,9 @@ static int _rtl92e_wx_set_encode_ext(struct net_device *dev,
mutex_lock(&priv->wx_mutex);
priv->rtllib->wx_set_enc = 1;
down(&priv->rtllib->ips_sem);
mutex_lock(&priv->rtllib->ips_mutex);
rtl92e_ips_leave(dev);
up(&priv->rtllib->ips_sem);
mutex_unlock(&priv->rtllib->ips_mutex);
ret = rtllib_wx_set_encode_ext(ieee, info, wrqu, extra);
{
......
......@@ -30,7 +30,6 @@
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <linux/sched.h>
#include <linux/semaphore.h>
#include <linux/mutex.h>
#include <linux/delay.h>
......@@ -1654,7 +1653,7 @@ struct rtllib_device {
struct mutex wx_mutex;
struct mutex scan_mutex;
struct semaphore ips_sem;
struct mutex ips_mutex;
spinlock_t mgmt_tx_lock;
spinlock_t beacon_lock;
......
......@@ -3036,7 +3036,7 @@ void rtllib_softmac_init(struct rtllib_device *ieee)
mutex_init(&ieee->wx_mutex);
mutex_init(&ieee->scan_mutex);
sema_init(&ieee->ips_sem, 1);
mutex_init(&ieee->ips_mutex);
spin_lock_init(&ieee->mgmt_tx_lock);
spin_lock_init(&ieee->beacon_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment