aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Lo <kevlo@kevlo.org>2020-12-20 22:18:19 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-10 09:29:13 +0100
commit0cda160418583c066a17a2881babd3522c08e859 (patch)
treef0c8d4e6e29054a7423963556c8737601b1d2db4
parent8e081627f3a7f733a4955ee40b385c972f010f05 (diff)
downloadkernel_replicant_linux-0cda160418583c066a17a2881babd3522c08e859.tar.gz
kernel_replicant_linux-0cda160418583c066a17a2881babd3522c08e859.tar.bz2
kernel_replicant_linux-0cda160418583c066a17a2881babd3522c08e859.zip
igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr
[ Upstream commit ebc8d125062e7dccb7922b2190b097c20d88ad96 ] This patch sets the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr. Without this change it wouldn't lead to a shadow RAM write EEWR timeout. Fixes: ab4056126813 ("igc: Add NVM support") Signed-off-by: Kevin Lo <kevlo@kevlo.org> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/intel/igc/igc_i225.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c b/drivers/net/ethernet/intel/igc/igc_i225.c
index 8b67d9b49a83..7ec04e48860c 100644
--- a/drivers/net/ethernet/intel/igc/igc_i225.c
+++ b/drivers/net/ethernet/intel/igc/igc_i225.c
@@ -219,9 +219,9 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
u16 *data)
{
struct igc_nvm_info *nvm = &hw->nvm;
+ s32 ret_val = -IGC_ERR_NVM;
u32 attempts = 100000;
u32 i, k, eewr = 0;
- s32 ret_val = 0;
/* A check for invalid values: offset too large, too many words,
* too many words for the offset, and not enough words.
@@ -229,7 +229,6 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) ||
words == 0) {
hw_dbg("nvm parameter(s) out of bounds\n");
- ret_val = -IGC_ERR_NVM;
goto out;
}