Commit 1abf9ae7 authored by Binoy Jayan's avatar Binoy Jayan Committed by Kalle Valo

mwifiex: Replace semaphore async_sem with mutex

The semaphore 'async_sem' is used as 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>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent c42ea613
...@@ -3033,7 +3033,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy, ...@@ -3033,7 +3033,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct wiphy *wiphy,
INIT_DELAYED_WORK(&priv->dfs_chan_sw_work, INIT_DELAYED_WORK(&priv->dfs_chan_sw_work,
mwifiex_dfs_chan_sw_work_queue); mwifiex_dfs_chan_sw_work_queue);
sema_init(&priv->async_sem, 1); mutex_init(&priv->async_mutex);
/* Register network device */ /* Register network device */
if (register_netdevice(dev)) { if (register_netdevice(dev)) {
......
...@@ -629,7 +629,7 @@ struct mwifiex_private { ...@@ -629,7 +629,7 @@ struct mwifiex_private {
struct dentry *dfs_dev_dir; struct dentry *dfs_dev_dir;
#endif #endif
u16 current_key_index; u16 current_key_index;
struct semaphore async_sem; struct mutex async_mutex;
struct cfg80211_scan_request *scan_request; struct cfg80211_scan_request *scan_request;
u8 cfg_bssid[6]; u8 cfg_bssid[6];
struct wps wps; struct wps wps;
......
...@@ -2809,7 +2809,7 @@ int mwifiex_request_scan(struct mwifiex_private *priv, ...@@ -2809,7 +2809,7 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
{ {
int ret; int ret;
if (down_interruptible(&priv->async_sem)) { if (mutex_lock_interruptible(&priv->async_mutex)) {
mwifiex_dbg(priv->adapter, ERROR, mwifiex_dbg(priv->adapter, ERROR,
"%s: acquire semaphore fail\n", "%s: acquire semaphore fail\n",
__func__); __func__);
...@@ -2825,7 +2825,7 @@ int mwifiex_request_scan(struct mwifiex_private *priv, ...@@ -2825,7 +2825,7 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
/* Normal scan */ /* Normal scan */
ret = mwifiex_scan_networks(priv, NULL); ret = mwifiex_scan_networks(priv, NULL);
up(&priv->async_sem); mutex_unlock(&priv->async_mutex);
return ret; return ret;
} }
......
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