aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/scan.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-10-19 22:19:17 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-29 15:20:33 -0400
commitb0e70c2fb67bc376c3114a709ce0852e71d37ecb (patch)
tree1cf166a22c78fb8e5e8ab8430d655a328ef262da /drivers/net/wireless/mwifiex/scan.c
parentf162cac83ba474eb71ea2aa7788bd77f1692f4d2 (diff)
mwifiex: minor cleanup and a fix in scan semaphore usage
mwifiex_request_scan() takes care of synchronous internal scan performed by driver during association. Currently the semaphore acquired for the scan is unnecessarily released at the end of different paths. Also, failure paths returning error code other than "-1" are not considered. We will release it at the end of routine to fix above issues. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/scan.c')
-rw-r--r--drivers/net/wireless/mwifiex/scan.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 32b79ddd774b..9c0ad0fe276a 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -1762,10 +1762,6 @@ int mwifiex_ret_802_11_scan(struct mwifiex_private *priv,
1762 } 1762 }
1763 if (priv->report_scan_result) 1763 if (priv->report_scan_result)
1764 priv->report_scan_result = false; 1764 priv->report_scan_result = false;
1765 if (priv->scan_pending_on_block) {
1766 priv->scan_pending_on_block = false;
1767 up(&priv->async_sem);
1768 }
1769 1765
1770 if (priv->user_scan_cfg) { 1766 if (priv->user_scan_cfg) {
1771 if (priv->scan_request) { 1767 if (priv->scan_request) {
@@ -1914,7 +1910,6 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
1914 __func__); 1910 __func__);
1915 return -1; 1911 return -1;
1916 } 1912 }
1917 priv->scan_pending_on_block = true;
1918 1913
1919 priv->adapter->scan_wait_q_woken = false; 1914 priv->adapter->scan_wait_q_woken = false;
1920 1915
@@ -1928,10 +1923,7 @@ int mwifiex_request_scan(struct mwifiex_private *priv,
1928 if (!ret) 1923 if (!ret)
1929 ret = mwifiex_wait_queue_complete(priv->adapter); 1924 ret = mwifiex_wait_queue_complete(priv->adapter);
1930 1925
1931 if (ret == -1) { 1926 up(&priv->async_sem);
1932 priv->scan_pending_on_block = false;
1933 up(&priv->async_sem);
1934 }
1935 1927
1936 return ret; 1928 return ret;
1937} 1929}