iwlwifi: mvm: remove useless argument in iwl_nvm_init()
authorLuca Coelho <luciano.coelho@intel.com>
Tue, 15 Aug 2017 15:46:44 +0000 (18:46 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 18 Aug 2017 14:36:42 +0000 (17:36 +0300)
We always call iwl_nvm_init() with read_nvm_from_nic == true, so this
argument is useless.  Remove it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c

index 90ae50f7768aded0d13b3165895369856c2f8081..3d65ab49a8a65060082293cae1d221f59247a77e 100644 (file)
@@ -388,7 +388,7 @@ static int iwl_run_unified_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
        }
 
        if (IWL_MVM_PARSE_NVM && read_nvm) {
-               ret = iwl_nvm_init(mvm, true);
+               ret = iwl_nvm_init(mvm);
                if (ret) {
                        IWL_ERR(mvm, "Failed to read NVM: %d\n", ret);
                        goto error;
@@ -486,8 +486,7 @@ int iwl_run_init_mvm_ucode(struct iwl_mvm *mvm, bool read_nvm)
 
        /* Read the NVM only at driver load time, no need to do this twice */
        if (read_nvm) {
-               /* Read nvm */
-               ret = iwl_nvm_init(mvm, true);
+               ret = iwl_nvm_init(mvm);
                if (ret) {
                        IWL_ERR(mvm, "Failed to read NVM: %d\n", ret);
                        goto remove_notif;
index 74fdd33fd9fb1ce70f323baf651f88671b736093..83303bac0e4babf6b1d3d41d1f0fc167b80c871e 100644 (file)
@@ -1373,7 +1373,7 @@ int iwl_mvm_request_statistics(struct iwl_mvm *mvm, bool clear);
 void iwl_mvm_accu_radio_stats(struct iwl_mvm *mvm);
 
 /* NVM */
-int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic);
+int iwl_nvm_init(struct iwl_mvm *mvm);
 int iwl_mvm_load_nvm_to_nic(struct iwl_mvm *mvm);
 int iwl_mvm_read_external_nvm(struct iwl_mvm *mvm);
 
index 08020386c3d40f25b3220ca76b26ec29bc3d2ff1..5a6916f0b9ec6f7ebac5cf67636ab2d243d343b7 100644 (file)
@@ -546,7 +546,7 @@ int iwl_mvm_load_nvm_to_nic(struct iwl_mvm *mvm)
        return ret;
 }
 
-int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic)
+int iwl_nvm_init(struct iwl_mvm *mvm)
 {
        int ret, section;
        u32 size_read = 0;
@@ -557,63 +557,61 @@ int iwl_nvm_init(struct iwl_mvm *mvm, bool read_nvm_from_nic)
                return -EINVAL;
 
        /* load NVM values from nic */
-       if (read_nvm_from_nic) {
-               /* Read From FW NVM */
-               IWL_DEBUG_EEPROM(mvm->trans->dev, "Read from NVM\n");
-
-               nvm_buffer = kmalloc(mvm->cfg->base_params->eeprom_size,
-                                    GFP_KERNEL);
-               if (!nvm_buffer)
-                       return -ENOMEM;
-               for (section = 0; section < NVM_MAX_NUM_SECTIONS; section++) {
-                       /* we override the constness for initial read */
-                       ret = iwl_nvm_read_section(mvm, section, nvm_buffer,
-                                                  size_read);
-                       if (ret < 0)
-                               continue;
-                       size_read += ret;
-                       temp = kmemdup(nvm_buffer, ret, GFP_KERNEL);
-                       if (!temp) {
-                               ret = -ENOMEM;
-                               break;
-                       }
+       /* Read From FW NVM */
+       IWL_DEBUG_EEPROM(mvm->trans->dev, "Read from NVM\n");
+
+       nvm_buffer = kmalloc(mvm->cfg->base_params->eeprom_size,
+                            GFP_KERNEL);
+       if (!nvm_buffer)
+               return -ENOMEM;
+       for (section = 0; section < NVM_MAX_NUM_SECTIONS; section++) {
+               /* we override the constness for initial read */
+               ret = iwl_nvm_read_section(mvm, section, nvm_buffer,
+                                          size_read);
+               if (ret < 0)
+                       continue;
+               size_read += ret;
+               temp = kmemdup(nvm_buffer, ret, GFP_KERNEL);
+               if (!temp) {
+                       ret = -ENOMEM;
+                       break;
+               }
 
-                       iwl_mvm_nvm_fixups(mvm, section, temp, ret);
+               iwl_mvm_nvm_fixups(mvm, section, temp, ret);
 
-                       mvm->nvm_sections[section].data = temp;
-                       mvm->nvm_sections[section].length = ret;
+               mvm->nvm_sections[section].data = temp;
+               mvm->nvm_sections[section].length = ret;
 
 #ifdef CONFIG_IWLWIFI_DEBUGFS
-                       switch (section) {
-                       case NVM_SECTION_TYPE_SW:
-                               mvm->nvm_sw_blob.data = temp;
-                               mvm->nvm_sw_blob.size  = ret;
-                               break;
-                       case NVM_SECTION_TYPE_CALIBRATION:
-                               mvm->nvm_calib_blob.data = temp;
-                               mvm->nvm_calib_blob.size  = ret;
-                               break;
-                       case NVM_SECTION_TYPE_PRODUCTION:
-                               mvm->nvm_prod_blob.data = temp;
-                               mvm->nvm_prod_blob.size  = ret;
-                               break;
-                       case NVM_SECTION_TYPE_PHY_SKU:
-                               mvm->nvm_phy_sku_blob.data = temp;
-                               mvm->nvm_phy_sku_blob.size  = ret;
+               switch (section) {
+               case NVM_SECTION_TYPE_SW:
+                       mvm->nvm_sw_blob.data = temp;
+                       mvm->nvm_sw_blob.size  = ret;
+                       break;
+               case NVM_SECTION_TYPE_CALIBRATION:
+                       mvm->nvm_calib_blob.data = temp;
+                       mvm->nvm_calib_blob.size  = ret;
+                       break;
+               case NVM_SECTION_TYPE_PRODUCTION:
+                       mvm->nvm_prod_blob.data = temp;
+                       mvm->nvm_prod_blob.size  = ret;
+                       break;
+               case NVM_SECTION_TYPE_PHY_SKU:
+                       mvm->nvm_phy_sku_blob.data = temp;
+                       mvm->nvm_phy_sku_blob.size  = ret;
+                       break;
+               default:
+                       if (section == mvm->cfg->nvm_hw_section_num) {
+                               mvm->nvm_hw_blob.data = temp;
+                               mvm->nvm_hw_blob.size = ret;
                                break;
-                       default:
-                               if (section == mvm->cfg->nvm_hw_section_num) {
-                                       mvm->nvm_hw_blob.data = temp;
-                                       mvm->nvm_hw_blob.size = ret;
-                                       break;
-                               }
                        }
-#endif
                }
-               if (!size_read)
-                       IWL_ERR(mvm, "OTP is blank\n");
-               kfree(nvm_buffer);
+#endif
        }
+       if (!size_read)
+               IWL_ERR(mvm, "OTP is blank\n");
+       kfree(nvm_buffer);
 
        /* Only if PNVM selected in the mod param - load external NVM  */
        if (mvm->nvm_file_name) {