iwlwifi: mvm: cleanup usage of init_dbg parameter
authorSara Sharon <sara.sharon@intel.com>
Wed, 31 Aug 2016 11:13:53 +0000 (14:13 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 22 Sep 2016 20:21:02 +0000 (23:21 +0300)
Move the init_dbg check to earlier in the function to simplify the
code.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/fw.c

index 7322c4394a9a0071a2c53ee2948868b62405060a..8f10780808f6c8502089383e54d432d2dd90a48b 100644 (file)
@@ -1115,27 +1115,27 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
         * (for example, if we were in RFKILL)
         */
        ret = iwl_run_init_mvm_ucode(mvm, false);
-       if (ret && !iwlmvm_mod_params.init_dbg) {
+
+       if (iwlmvm_mod_params.init_dbg)
+               return 0;
+
+       if (ret) {
                IWL_ERR(mvm, "Failed to run INIT ucode: %d\n", ret);
                /* this can't happen */
                if (WARN_ON(ret > 0))
                        ret = -ERFKILL;
                goto error;
        }
-       if (!iwlmvm_mod_params.init_dbg) {
-               /*
-                * Stop and start the transport without entering low power
-                * mode. This will save the state of other components on the
-                * device that are triggered by the INIT firwmare (MFUART).
-                */
-               _iwl_trans_stop_device(mvm->trans, false);
-               ret = _iwl_trans_start_hw(mvm->trans, false);
-               if (ret)
-                       goto error;
-       }
 
-       if (iwlmvm_mod_params.init_dbg)
-               return 0;
+       /*
+        * Stop and start the transport without entering low power
+        * mode. This will save the state of other components on the
+        * device that are triggered by the INIT firwmare (MFUART).
+        */
+       _iwl_trans_stop_device(mvm->trans, false);
+       ret = _iwl_trans_start_hw(mvm->trans, false);
+       if (ret)
+               goto error;
 
        ret = iwl_mvm_load_ucode_wait_alive(mvm, IWL_UCODE_REGULAR);
        if (ret) {