diff options
author | Binoy Jayan <binoy.jayan@linaro.org> | 2016-06-02 06:53:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-18 22:50:48 -0400 |
commit | 87d63bcc0f98248be03a1eb8cb3431b7c395bcae (patch) | |
tree | acae1f9110f6202f68fa20ea43539042565d7b6c | |
parent | e379a9a87952f5b16cbad8f89a8826c4df2fcb31 (diff) |
rtl8192u: Replace semaphore scan_sem with mutex
The semaphore 'scan_sem' in rtl8192u is a simple mutex, so it should
be written as one. Semaphores are going away in the future.
Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index ef9ae22e6601..09e9499b7f9d 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h | |||
@@ -1800,7 +1800,7 @@ struct ieee80211_device { | |||
1800 | short proto_started; | 1800 | short proto_started; |
1801 | 1801 | ||
1802 | struct mutex wx_mutex; | 1802 | struct mutex wx_mutex; |
1803 | struct semaphore scan_sem; | 1803 | struct mutex scan_mutex; |
1804 | 1804 | ||
1805 | spinlock_t mgmt_tx_lock; | 1805 | spinlock_t mgmt_tx_lock; |
1806 | spinlock_t beacon_lock; | 1806 | spinlock_t beacon_lock; |
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 664664bed592..49db1b75cd05 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | |||
@@ -427,7 +427,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee) | |||
427 | short ch = 0; | 427 | short ch = 0; |
428 | u8 channel_map[MAX_CHANNEL_NUMBER+1]; | 428 | u8 channel_map[MAX_CHANNEL_NUMBER+1]; |
429 | memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1); | 429 | memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1); |
430 | down(&ieee->scan_sem); | 430 | mutex_lock(&ieee->scan_mutex); |
431 | 431 | ||
432 | while(1) | 432 | while(1) |
433 | { | 433 | { |
@@ -475,13 +475,13 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee) | |||
475 | out: | 475 | out: |
476 | if(ieee->state < IEEE80211_LINKED){ | 476 | if(ieee->state < IEEE80211_LINKED){ |
477 | ieee->actscanning = false; | 477 | ieee->actscanning = false; |
478 | up(&ieee->scan_sem); | 478 | mutex_unlock(&ieee->scan_mutex); |
479 | } | 479 | } |
480 | else{ | 480 | else{ |
481 | ieee->sync_scan_hurryup = 0; | 481 | ieee->sync_scan_hurryup = 0; |
482 | if(IS_DOT11D_ENABLE(ieee)) | 482 | if(IS_DOT11D_ENABLE(ieee)) |
483 | DOT11D_ScanComplete(ieee); | 483 | DOT11D_ScanComplete(ieee); |
484 | up(&ieee->scan_sem); | 484 | mutex_unlock(&ieee->scan_mutex); |
485 | } | 485 | } |
486 | } | 486 | } |
487 | EXPORT_SYMBOL(ieee80211_softmac_scan_syncro); | 487 | EXPORT_SYMBOL(ieee80211_softmac_scan_syncro); |
@@ -495,7 +495,7 @@ static void ieee80211_softmac_scan_wq(struct work_struct *work) | |||
495 | memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1); | 495 | memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1); |
496 | if(!ieee->ieee_up) | 496 | if(!ieee->ieee_up) |
497 | return; | 497 | return; |
498 | down(&ieee->scan_sem); | 498 | mutex_lock(&ieee->scan_mutex); |
499 | do{ | 499 | do{ |
500 | ieee->current_network.channel = | 500 | ieee->current_network.channel = |
501 | (ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER; | 501 | (ieee->current_network.channel + 1) % MAX_CHANNEL_NUMBER; |
@@ -517,7 +517,7 @@ static void ieee80211_softmac_scan_wq(struct work_struct *work) | |||
517 | 517 | ||
518 | schedule_delayed_work(&ieee->softmac_scan_wq, IEEE80211_SOFTMAC_SCAN_TIME); | 518 | schedule_delayed_work(&ieee->softmac_scan_wq, IEEE80211_SOFTMAC_SCAN_TIME); |
519 | 519 | ||
520 | up(&ieee->scan_sem); | 520 | mutex_unlock(&ieee->scan_mutex); |
521 | return; | 521 | return; |
522 | out: | 522 | out: |
523 | if(IS_DOT11D_ENABLE(ieee)) | 523 | if(IS_DOT11D_ENABLE(ieee)) |
@@ -525,7 +525,7 @@ out: | |||
525 | ieee->actscanning = false; | 525 | ieee->actscanning = false; |
526 | watchdog = 0; | 526 | watchdog = 0; |
527 | ieee->scanning = 0; | 527 | ieee->scanning = 0; |
528 | up(&ieee->scan_sem); | 528 | mutex_unlock(&ieee->scan_mutex); |
529 | } | 529 | } |
530 | 530 | ||
531 | 531 | ||
@@ -579,7 +579,7 @@ static void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee) | |||
579 | 579 | ||
580 | //ieee->sync_scan_hurryup = 1; | 580 | //ieee->sync_scan_hurryup = 1; |
581 | 581 | ||
582 | down(&ieee->scan_sem); | 582 | mutex_lock(&ieee->scan_mutex); |
583 | // spin_lock_irqsave(&ieee->lock, flags); | 583 | // spin_lock_irqsave(&ieee->lock, flags); |
584 | 584 | ||
585 | if (ieee->scanning == 1) { | 585 | if (ieee->scanning == 1) { |
@@ -589,7 +589,7 @@ static void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee) | |||
589 | } | 589 | } |
590 | 590 | ||
591 | // spin_unlock_irqrestore(&ieee->lock, flags); | 591 | // spin_unlock_irqrestore(&ieee->lock, flags); |
592 | up(&ieee->scan_sem); | 592 | mutex_unlock(&ieee->scan_mutex); |
593 | } | 593 | } |
594 | 594 | ||
595 | void ieee80211_stop_scan(struct ieee80211_device *ieee) | 595 | void ieee80211_stop_scan(struct ieee80211_device *ieee) |
@@ -2729,7 +2729,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee) | |||
2729 | 2729 | ||
2730 | 2730 | ||
2731 | mutex_init(&ieee->wx_mutex); | 2731 | mutex_init(&ieee->wx_mutex); |
2732 | sema_init(&ieee->scan_sem, 1); | 2732 | mutex_init(&ieee->scan_mutex); |
2733 | 2733 | ||
2734 | spin_lock_init(&ieee->mgmt_tx_lock); | 2734 | spin_lock_init(&ieee->mgmt_tx_lock); |
2735 | spin_lock_init(&ieee->beacon_lock); | 2735 | spin_lock_init(&ieee->beacon_lock); |