Commit ebc8d125 authored by Kevin Lo's avatar Kevin Lo Committed by Tony Nguyen

igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr

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: ab405612 ("igc: Add NVM support")
Signed-off-by: default avatarKevin Lo <kevlo@kevlo.org>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 2e99dedc
...@@ -219,9 +219,9 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words, ...@@ -219,9 +219,9 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
u16 *data) u16 *data)
{ {
struct igc_nvm_info *nvm = &hw->nvm; struct igc_nvm_info *nvm = &hw->nvm;
s32 ret_val = -IGC_ERR_NVM;
u32 attempts = 100000; u32 attempts = 100000;
u32 i, k, eewr = 0; u32 i, k, eewr = 0;
s32 ret_val = 0;
/* A check for invalid values: offset too large, too many words, /* A check for invalid values: offset too large, too many words,
* too many words for the offset, and not enough 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, ...@@ -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)) || if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) ||
words == 0) { words == 0) {
hw_dbg("nvm parameter(s) out of bounds\n"); hw_dbg("nvm parameter(s) out of bounds\n");
ret_val = -IGC_ERR_NVM;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment