summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000
diff options
context:
space:
mode:
authorChaehyun Lim <chaehyun.lim@gmail.com>2016-03-23 21:28:34 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-03-28 07:30:36 -0700
commit2bb02584cd95405da72b009d0960f803d31e2302 (patch)
treeda8797c37e8b73dfcec114f4e3ed9a79ded6b4d8 /drivers/staging/wilc1000
parent04dd9a421111dfb88e1ae73af0ea27f285c89b74 (diff)
downloadop-kernel-dev-2bb02584cd95405da72b009d0960f803d31e2302.zip
op-kernel-dev-2bb02584cd95405da72b009d0960f803d31e2302.tar.gz
staging: wilc1000: use completion instead of struct semaphore hif_sema_driver
struct semaphore hif_sema_driver is used to signal completion of host interface message. This patch replaces struct semaphore hif_sema_driver with struct completion hif_driver_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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 3d17972..29d4d8a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -232,7 +232,7 @@ static u8 P2P_LISTEN_STATE;
static struct task_struct *hif_thread_handler;
static struct message_queue hif_msg_q;
static struct completion hif_thread_comp;
-static struct semaphore hif_sema_driver;
+static struct completion hif_driver_comp;
static struct completion hif_wait_response;
static struct mutex hif_deinit_lock;
static struct timer_list periodic_rssi;
@@ -321,7 +321,7 @@ static s32 handle_set_wfi_drv_handler(struct wilc_vif *vif,
hif_drv_handler->handler);
if (!hif_drv_handler->handler)
- up(&hif_sema_driver);
+ complete(&hif_driver_comp);
if (result) {
netdev_err(vif->ndev, "Failed to set driver handler\n");
@@ -346,7 +346,7 @@ static s32 handle_set_operation_mode(struct wilc_vif *vif,
wilc_get_vif_idx(vif));
if ((hif_op_mode->mode) == IDLE_MODE)
- up(&hif_sema_driver);
+ complete(&hif_driver_comp);
if (result) {
netdev_err(vif->ndev, "Failed to set driver handler\n");
@@ -3401,7 +3401,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
if (clients_count == 0) {
init_completion(&hif_thread_comp);
- sema_init(&hif_sema_driver, 0);
+ init_completion(&hif_driver_comp);
mutex_init(&hif_deinit_lock);
}
@@ -3480,7 +3480,7 @@ int wilc_deinit(struct wilc_vif *vif)
del_timer_sync(&hif_drv->remain_on_ch_timer);
wilc_set_wfi_drv_handler(vif, 0, 0);
- down(&hif_sema_driver);
+ wait_for_completion(&hif_driver_comp);
if (hif_drv->usr_scan_req.scan_result) {
hif_drv->usr_scan_req.scan_result(SCAN_EVENT_ABORTED, NULL,
OpenPOWER on IntegriCloud