diff options
author | Alison Schofield <[email protected]> | 2016-03-14 10:35:05 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2016-03-28 07:30:36 -0700 |
commit | 96adbd276e7194320f08fd7f00c4a1be2d910d11 (patch) | |
tree | fa3788b68c150e7c52ee680fffd39e5d8e9af097 | |
parent | 7c8a3dcac82f11681e3e6ad61fb2e5802a136c24 (diff) |
staging: wilc1000: replace sem_test_disconn_block with a completion
Semaphore sem_test_disconn_block is used to signal completion of its
host interface message. Since the thread locking this semaphore will
have to wait, completions are the preferred mechanism and will offer
a performance improvement.
Signed-off-by: Alison Schofield <[email protected]>
Reviewed-by: Arnd Bergmann <[email protected]>
Tested-by: Leo Kim <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/staging/wilc1000/host_interface.c | 6 | ||||
-rw-r--r-- | drivers/staging/wilc1000/host_interface.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 697491e8cfb2..ed7f011b3eca 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -1857,7 +1857,7 @@ static void Handle_Disconnect(struct wilc_vif *vif) } } - up(&hif_drv->sem_test_disconn_block); + complete(&hif_drv->comp_test_disconn_block); } void wilc_resolve_disconnect_aberration(struct wilc_vif *vif) @@ -3099,7 +3099,7 @@ int wilc_disconnect(struct wilc_vif *vif, u16 reason_code) if (result) netdev_err(vif->ndev, "Failed to send message: disconnect\n"); - down(&hif_drv->sem_test_disconn_block); + wait_for_completion(&hif_drv->comp_test_disconn_block); return result; } @@ -3406,7 +3406,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) } sema_init(&hif_drv->sem_test_key_block, 0); - sema_init(&hif_drv->sem_test_disconn_block, 0); + init_completion(&hif_drv->comp_test_disconn_block); init_completion(&hif_drv->comp_get_rssi); init_completion(&hif_drv->comp_inactive_time); diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h index 085adeeaa767..3ab94a7ba5e9 100644 --- a/drivers/staging/wilc1000/host_interface.h +++ b/drivers/staging/wilc1000/host_interface.h @@ -276,7 +276,7 @@ struct host_if_drv { struct mutex cfg_values_lock; struct semaphore sem_test_key_block; - struct semaphore sem_test_disconn_block; + struct completion comp_test_disconn_block; struct completion comp_get_rssi; struct completion comp_inactive_time; |