linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 13/15] iwlwifi: pcie: propagate iwl_pcie_apm_init's status
Date: Thu, 29 Jun 2017 21:30:25 +0300	[thread overview]
Message-ID: <20170629183027.15408-14-luca@coelho.fi> (raw)
In-Reply-To: <20170629183027.15408-1-luca@coelho.fi>

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

iwl_pcie_apm_init can fail so make sure that the caller
takes the status into account.
Also, ensure that the error that iwl_pcie_apm_init can emit
will appear in the kernel log by default.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index a7d0b5c5e4a0..cac584cc07b6 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -236,7 +236,8 @@ void iwl_pcie_apm_config(struct iwl_trans *trans)
  */
 static int iwl_pcie_apm_init(struct iwl_trans *trans)
 {
-	int ret = 0;
+	int ret;
+
 	IWL_DEBUG_INFO(trans, "Init card's basic functions\n");
 
 	/*
@@ -287,8 +288,8 @@ static int iwl_pcie_apm_init(struct iwl_trans *trans)
 			   CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
 			   CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
 	if (ret < 0) {
-		IWL_DEBUG_INFO(trans, "Failed to init the card\n");
-		goto out;
+		IWL_ERR(trans, "Failed to init the card\n");
+		return ret;
 	}
 
 	if (trans->cfg->host_interrupt_operation_mode) {
@@ -336,8 +337,7 @@ static int iwl_pcie_apm_init(struct iwl_trans *trans)
 
 	set_bit(STATUS_DEVICE_ENABLED, &trans->status);
 
-out:
-	return ret;
+	return 0;
 }
 
 /*
@@ -514,13 +514,16 @@ static void iwl_pcie_apm_stop(struct iwl_trans *trans, bool op_mode_leave)
 static int iwl_pcie_nic_init(struct iwl_trans *trans)
 {
 	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
+	int ret;
 
 	/* nic_init */
 	spin_lock(&trans_pcie->irq_lock);
-	iwl_pcie_apm_init(trans);
-
+	ret = iwl_pcie_apm_init(trans);
 	spin_unlock(&trans_pcie->irq_lock);
 
+	if (ret)
+		return ret;
+
 	iwl_pcie_set_pwr(trans, false);
 
 	iwl_op_mode_nic_config(trans->op_mode);
@@ -1658,7 +1661,9 @@ static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power)
 	iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
 	usleep_range(1000, 2000);
 
-	iwl_pcie_apm_init(trans);
+	err = iwl_pcie_apm_init(trans);
+	if (err)
+		return err;
 
 	iwl_pcie_init_msix(trans_pcie);
 
-- 
2.11.0

  parent reply	other threads:[~2017-06-29 18:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-29 18:30 [PATCH 00/15] iwlwifi: updates intended for v4.13 2017-06-29 Luca Coelho
2017-06-29 18:30 ` [PATCH 01/15] iwlwifi: mvm: quietly accept non-sta assoc response frames Luca Coelho
2017-06-29 18:30 ` [PATCH 02/15] iwlwifi: pcie: add MSI-X interrupt tracing Luca Coelho
2017-06-29 18:30 ` [PATCH 03/15] iwlwifi: mvm: properly enable IP header checksumming Luca Coelho
2017-06-29 18:30 ` [PATCH 04/15] iwlwifi: mvm: fix mac80211 queue tracking Luca Coelho
2017-06-29 18:30 ` [PATCH 05/15] iwlwifi: mvm: map cab_queue to real one earlier Luca Coelho
2017-06-29 18:30 ` [PATCH 06/15] iwlwifi: mvm: fix mac80211's hw_queue in DQA mode Luca Coelho
2017-06-29 18:30 ` [PATCH 07/15] iwlwifi: mvm: don't send fetch the TID from a non-QoS packet in TSO Luca Coelho
2017-06-29 18:30 ` [PATCH 08/15] iwlwifi: pcie: reconfigure MSI-X HW on resume Luca Coelho
2017-06-29 18:30 ` [PATCH 09/15] iwlwifi: mvm: don't mess the SNAP header in TSO for non-QoS packets Luca Coelho
2017-06-29 18:30 ` [PATCH 10/15] iwlwifi: mvm: remove DQA non-STA client mode special case Luca Coelho
2017-06-29 18:30 ` [PATCH 11/15] iwlwifi: mvm: update rx statistics cmd api Luca Coelho
2017-06-29 18:30 ` [PATCH 12/15] iwlwifi: mvm: quietly accept non-sta disassoc frames Luca Coelho
2017-06-29 18:30 ` Luca Coelho [this message]
2017-06-29 18:30 ` [PATCH 14/15] iwlwifi: pcie: wait longer after device reset Luca Coelho
2017-06-29 18:30 ` [PATCH 15/15] iwlwifi: bump MAX API for 8000/9000/A000 to 33 Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170629183027.15408-14-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=emmanuel.grumbach@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).