diff options
author | Binoy Jayan <binoy.jayan@linaro.org> | 2016-06-15 11:00:35 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-25 14:39:53 -0700 |
commit | 334bed089d3d74e64a34b0ebee52b146b6778a6b (patch) | |
tree | d09f5ea633c4c1fe318515d68f2a72a9b2b10e10 /drivers/staging/wilc1000/wilc_wlan.c | |
parent | staging: wilc1000: Replace semaphore txq_event with completion (diff) | |
download | wireguard-linux-334bed089d3d74e64a34b0ebee52b146b6778a6b.tar.xz wireguard-linux-334bed089d3d74e64a34b0ebee52b146b6778a6b.zip |
staging: wilc1000: Replace semaphore txq_add_to_head_cs with mutex
The semaphore 'txq_add_to_head_cs' is a simple mutex, so it should be
written as one. Semaphores are going away in the future. Also, removing
the timeout scenario as the error handling code does not propagate the
timeout properly.
Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r-- | drivers/staging/wilc1000/wilc_wlan.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c index 1a571352bc96..9afbe8dc327f 100644 --- a/drivers/staging/wilc1000/wilc_wlan.c +++ b/drivers/staging/wilc1000/wilc_wlan.c @@ -99,9 +99,7 @@ static int wilc_wlan_txq_add_to_head(struct wilc_vif *vif, unsigned long flags; struct wilc *wilc = vif->wilc; - if (wilc_lock_timeout(wilc, &wilc->txq_add_to_head_cs, - CFG_PKTS_TIMEOUT)) - return -1; + mutex_lock(&wilc->txq_add_to_head_cs); spin_lock_irqsave(&wilc->txq_spinlock, flags); @@ -119,7 +117,7 @@ static int wilc_wlan_txq_add_to_head(struct wilc_vif *vif, wilc->txq_entries += 1; spin_unlock_irqrestore(&wilc->txq_spinlock, flags); - up(&wilc->txq_add_to_head_cs); + mutex_unlock(&wilc->txq_add_to_head_cs); complete(&wilc->txq_event); return 0; @@ -573,8 +571,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count) if (wilc->quit) break; - wilc_lock_timeout(wilc, &wilc->txq_add_to_head_cs, - CFG_PKTS_TIMEOUT); + mutex_lock(&wilc->txq_add_to_head_cs); wilc_wlan_txq_filter_dup_tcp_ack(dev); tqe = wilc_wlan_txq_get_first(wilc); i = 0; @@ -755,7 +752,7 @@ _end_: if (ret != 1) break; } while (0); - up(&wilc->txq_add_to_head_cs); + mutex_unlock(&wilc->txq_add_to_head_cs); wilc->txq_exit = 1; *txq_count = wilc->txq_entries; |