@@ -727,6 +727,7 @@ int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b)
727
727
struct iwl_dev_tx_power_cmd_v4 v4 ;
728
728
} cmd ;
729
729
730
+ int ret ;
730
731
u16 len = 0 ;
731
732
732
733
cmd .v5 .v3 .set_mode = cpu_to_le32 (IWL_TX_POWER_MODE_SET_CHAINS );
@@ -741,9 +742,14 @@ int iwl_mvm_sar_select_profile(struct iwl_mvm *mvm, int prof_a, int prof_b)
741
742
len = sizeof (cmd .v4 .v3 );
742
743
743
744
744
- if (iwl_sar_select_profile (& mvm -> fwrt , cmd .v5 .v3 .per_chain_restriction ,
745
- prof_a , prof_b ))
746
- return - ENOENT ;
745
+ ret = iwl_sar_select_profile (& mvm -> fwrt ,
746
+ cmd .v5 .v3 .per_chain_restriction ,
747
+ prof_a , prof_b );
748
+
749
+ /* return on error or if the profile is disabled (positive number) */
750
+ if (ret )
751
+ return ret ;
752
+
747
753
IWL_DEBUG_RADIO (mvm , "Sending REDUCE_TX_POWER_CMD per chain\n" );
748
754
return iwl_mvm_send_cmd_pdu (mvm , REDUCE_TX_POWER_CMD , 0 , len , & cmd );
749
755
}
@@ -1034,16 +1040,7 @@ static int iwl_mvm_sar_init(struct iwl_mvm *mvm)
1034
1040
"EWRD SAR BIOS table invalid or unavailable. (%d)\n" ,
1035
1041
ret );
1036
1042
1037
- ret = iwl_mvm_sar_select_profile (mvm , 1 , 1 );
1038
- /*
1039
- * If we don't have profile 0 from BIOS, just skip it. This
1040
- * means that SAR Geo will not be enabled either, even if we
1041
- * have other valid profiles.
1042
- */
1043
- if (ret == - ENOENT )
1044
- return 1 ;
1045
-
1046
- return ret ;
1043
+ return iwl_mvm_sar_select_profile (mvm , 1 , 1 );
1047
1044
}
1048
1045
1049
1046
static int iwl_mvm_load_rt_fw (struct iwl_mvm * mvm )
@@ -1272,7 +1269,7 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
1272
1269
ret = iwl_mvm_sar_init (mvm );
1273
1270
if (ret == 0 ) {
1274
1271
ret = iwl_mvm_sar_geo_init (mvm );
1275
- } else if (ret > 0 && !iwl_sar_get_wgds_table (& mvm -> fwrt )) {
1272
+ } else if (ret == - ENOENT && !iwl_sar_get_wgds_table (& mvm -> fwrt )) {
1276
1273
/*
1277
1274
* If basic SAR is not available, we check for WGDS,
1278
1275
* which should *not* be available either. If it is
0 commit comments