提交 52b6e168 编写于 作者: E Emmanuel Grumbach 提交者: Luca Coelho

iwlwifi: pcie: propagate iwl_pcie_apm_init's status

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: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
上级 51da3d8b
...@@ -236,7 +236,8 @@ void iwl_pcie_apm_config(struct iwl_trans *trans) ...@@ -236,7 +236,8 @@ void iwl_pcie_apm_config(struct iwl_trans *trans)
*/ */
static int iwl_pcie_apm_init(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"); IWL_DEBUG_INFO(trans, "Init card's basic functions\n");
/* /*
...@@ -287,8 +288,8 @@ static int iwl_pcie_apm_init(struct iwl_trans *trans) ...@@ -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,
CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
if (ret < 0) { if (ret < 0) {
IWL_DEBUG_INFO(trans, "Failed to init the card\n"); IWL_ERR(trans, "Failed to init the card\n");
goto out; return ret;
} }
if (trans->cfg->host_interrupt_operation_mode) { if (trans->cfg->host_interrupt_operation_mode) {
...@@ -336,8 +337,7 @@ static int iwl_pcie_apm_init(struct iwl_trans *trans) ...@@ -336,8 +337,7 @@ static int iwl_pcie_apm_init(struct iwl_trans *trans)
set_bit(STATUS_DEVICE_ENABLED, &trans->status); set_bit(STATUS_DEVICE_ENABLED, &trans->status);
out: return 0;
return ret;
} }
/* /*
...@@ -514,13 +514,16 @@ static void iwl_pcie_apm_stop(struct iwl_trans *trans, bool op_mode_leave) ...@@ -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) static int iwl_pcie_nic_init(struct iwl_trans *trans)
{ {
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
int ret;
/* nic_init */ /* nic_init */
spin_lock(&trans_pcie->irq_lock); spin_lock(&trans_pcie->irq_lock);
iwl_pcie_apm_init(trans); ret = iwl_pcie_apm_init(trans);
spin_unlock(&trans_pcie->irq_lock); spin_unlock(&trans_pcie->irq_lock);
if (ret)
return ret;
iwl_pcie_set_pwr(trans, false); iwl_pcie_set_pwr(trans, false);
iwl_op_mode_nic_config(trans->op_mode); 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) ...@@ -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); iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
usleep_range(1000, 2000); 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); iwl_pcie_init_msix(trans_pcie);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册