aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-scan.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2010-09-13 08:46:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-09-14 16:14:25 -0400
commit74d81b259d6c8493f066e34c939cb6fb7d3129e5 (patch)
treeb2e108aeb1f252187896cff3e2712438c9d0529c /drivers/net/wireless/iwlwifi/iwl-scan.c
parentedeb78a7fa838b7fb9c2043680bd8da7cb5cb0e5 (diff)
iwlwifi: cleanup scan initiate check
Remove redundant checks and use iwl_is_ready_rf(). Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi W Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index af9a83669f5e..26dd8f3228c0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -361,7 +361,7 @@ static int __must_check iwl_scan_initiate(struct iwl_priv *priv,
361 361
362 cancel_delayed_work(&priv->scan_check); 362 cancel_delayed_work(&priv->scan_check);
363 363
364 if (!iwl_is_ready(priv)) { 364 if (!iwl_is_ready_rf(priv)) {
365 IWL_WARN(priv, "request scan called when driver not ready.\n"); 365 IWL_WARN(priv, "request scan called when driver not ready.\n");
366 return -EIO; 366 return -EIO;
367 } 367 }
@@ -372,26 +372,11 @@ static int __must_check iwl_scan_initiate(struct iwl_priv *priv,
372 return -EBUSY; 372 return -EBUSY;
373 } 373 }
374 374
375 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
376 IWL_DEBUG_SCAN(priv, "Aborting scan due to device shutdown\n");
377 return -EIO;
378 }
379
380 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) { 375 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
381 IWL_DEBUG_HC(priv, "Scan request while abort pending.\n"); 376 IWL_DEBUG_HC(priv, "Scan request while abort pending.\n");
382 return -EBUSY; 377 return -EBUSY;
383 } 378 }
384 379
385 if (iwl_is_rfkill(priv)) {
386 IWL_DEBUG_HC(priv, "Aborting scan due to RF Kill activation\n");
387 return -EIO;
388 }
389
390 if (!test_bit(STATUS_READY, &priv->status)) {
391 IWL_DEBUG_HC(priv, "Scan request while uninitialized.\n");
392 return -EBUSY;
393 }
394
395 IWL_DEBUG_INFO(priv, "Starting %sscan...\n", 380 IWL_DEBUG_INFO(priv, "Starting %sscan...\n",
396 internal ? "internal short " : ""); 381 internal ? "internal short " : "");
397 382