Skip to content

Commit

Permalink
iwlwifi: cleanup scan initiate check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stanislaw Gruszka authored and John W. Linville committed Sep 14, 2010
1 parent edeb78a commit 74d81b2
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions drivers/net/wireless/iwlwifi/iwl-scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ static int __must_check iwl_scan_initiate(struct iwl_priv *priv,

cancel_delayed_work(&priv->scan_check);

if (!iwl_is_ready(priv)) {
if (!iwl_is_ready_rf(priv)) {
IWL_WARN(priv, "request scan called when driver not ready.\n");
return -EIO;
}
Expand All @@ -372,26 +372,11 @@ static int __must_check iwl_scan_initiate(struct iwl_priv *priv,
return -EBUSY;
}

if (test_bit(STATUS_EXIT_PENDING, &priv->status)) {
IWL_DEBUG_SCAN(priv, "Aborting scan due to device shutdown\n");
return -EIO;
}

if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
IWL_DEBUG_HC(priv, "Scan request while abort pending.\n");
return -EBUSY;
}

if (iwl_is_rfkill(priv)) {
IWL_DEBUG_HC(priv, "Aborting scan due to RF Kill activation\n");
return -EIO;
}

if (!test_bit(STATUS_READY, &priv->status)) {
IWL_DEBUG_HC(priv, "Scan request while uninitialized.\n");
return -EBUSY;
}

IWL_DEBUG_INFO(priv, "Starting %sscan...\n",
internal ? "internal short " : "");

Expand Down

0 comments on commit 74d81b2

Please sign in to comment.