From: Emmanuel Grumbach Date: Sun, 15 Sep 2013 08:37:17 +0000 (+0300) Subject: iwlwifi: don't WARN on host commands sent when firmware is dead X-Git-Tag: submit/tizen_common/20140905.094502~1921^2~20^2^2~8^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ca95995e64f5d270889badb3e449dca91106a2b;p=sdk%2Femulator%2Femulator-kernel.git iwlwifi: don't WARN on host commands sent when firmware is dead This triggers automatic bug reports and add no valuable information. Print a simple error instead and drop the host command. Signed-off-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index dd57a36..80b4750 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h @@ -601,8 +601,10 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans, { int ret; - WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, - "%s bad state = %d", __func__, trans->state); + if (trans->state != IWL_TRANS_FW_ALIVE) { + IWL_ERR(trans, "%s bad state = %d", __func__, trans->state); + return -EIO; + } if (!(cmd->flags & CMD_ASYNC)) lock_map_acquire_read(&trans->sync_cmd_lockdep_map);