summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/linux_wlan.c
diff options
context:
space:
mode:
authorLeo Kim <leo.kim@atmel.com>2016-04-01 17:44:15 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-28 21:58:42 -0700
commit11a54b3f9932efb7d2c07350834bb37ea0ba7cf9 (patch)
tree91beeeb934a4a332d57bd120123c6e13e9e2fe03 /drivers/staging/wilc1000/linux_wlan.c
parent01c7cee913e431e88159c70dae330dd40aa72677 (diff)
downloadop-kernel-dev-11a54b3f9932efb7d2c07350834bb37ea0ba7cf9.zip
op-kernel-dev-11a54b3f9932efb7d2c07350834bb37ea0ba7cf9.tar.gz
staging: wilc1000: txq_thread_started: replaces a semaphore with a completion
This patch replaces a semaphore(txq_thread_started) with a completion. Struct semaphore txq_thread_started is used to signal completion of txq thread. It is better to use completion than semaphore for this case. Signed-off-by: Leo Kim <leo.kim@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/linux_wlan.c')
-rw-r--r--drivers/staging/wilc1000/linux_wlan.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index a858552..2ed2bf3 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -22,6 +22,7 @@
#include <linux/skbuff.h>
#include <linux/semaphore.h>
+#include <linux/completion.h>
static int dev_state_ev_handler(struct notifier_block *this,
unsigned long event, void *ptr);
@@ -313,12 +314,12 @@ static int linux_wlan_txq_task(void *vp)
vif = netdev_priv(dev);
wl = vif->wilc;
- up(&wl->txq_thread_started);
+ complete(&wl->txq_thread_started);
while (1) {
down(&wl->txq_event);
if (wl->close) {
- up(&wl->txq_thread_started);
+ complete(&wl->txq_thread_started);
while (!kthread_should_stop())
schedule();
@@ -693,8 +694,7 @@ static int wlan_init_locks(struct net_device *dev)
sema_init(&wl->cfg_event, 0);
sema_init(&wl->sync_event, 0);
-
- sema_init(&wl->txq_thread_started, 0);
+ init_completion(&wl->txq_thread_started);
return 0;
}
@@ -731,7 +731,7 @@ static int wlan_initialize_threads(struct net_device *dev)
wilc->close = 0;
return -ENOBUFS;
}
- down(&wilc->txq_thread_started);
+ wait_for_completion(&wilc->txq_thread_started);
return 0;
}
OpenPOWER on IntegriCloud