summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000
diff options
context:
space:
mode:
authorChaehyun Lim <chaehyun.lim@gmail.com>2016-03-23 21:28:33 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-28 07:30:36 -0700
commit04dd9a421111dfb88e1ae73af0ea27f285c89b74 (patch)
tree79bf2b27b8191c68378073616c5b27116af3c637 /drivers/staging/wilc1000
parent85d83cd8c629e053e3aaec0a4dd6c798d46c109d (diff)
downloadop-kernel-dev-04dd9a421111dfb88e1ae73af0ea27f285c89b74.zip
op-kernel-dev-04dd9a421111dfb88e1ae73af0ea27f285c89b74.tar.gz
staging: wilc1000: use completion instead of struct semaphore hif_sema_thread
struct semaphore hif_sema_thread is used to signal completion of host interface thread. This patch replaces struct semaphore hif_sema_thread with struct completion hif_thread_comp. It is better to use completion than semaphore for this case. Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r--drivers/staging/wilc1000/host_interface.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index b1ffa91..3d17972 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -231,7 +231,7 @@ bool wilc_optaining_ip;
static u8 P2P_LISTEN_STATE;
static struct task_struct *hif_thread_handler;
static struct message_queue hif_msg_q;
-static struct semaphore hif_sema_thread;
+static struct completion hif_thread_comp;
static struct semaphore hif_sema_driver;
static struct completion hif_wait_response;
static struct mutex hif_deinit_lock;
@@ -2668,7 +2668,7 @@ static int hostIFthread(void *pvArg)
}
}
- up(&hif_sema_thread);
+ complete(&hif_thread_comp);
return 0;
}
@@ -3400,7 +3400,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
wilc_optaining_ip = false;
if (clients_count == 0) {
- sema_init(&hif_sema_thread, 0);
+ init_completion(&hif_thread_comp);
sema_init(&hif_sema_driver, 0);
mutex_init(&hif_deinit_lock);
}
@@ -3503,7 +3503,7 @@ int wilc_deinit(struct wilc_vif *vif)
if (result != 0)
netdev_err(vif->ndev, "deinit : Error(%d)\n", result);
- down(&hif_sema_thread);
+ wait_for_completion(&hif_thread_comp);
wilc_mq_destroy(&hif_msg_q);
}
OpenPOWER on IntegriCloud