Skip to content

Commit ebc8d12

Browse files
kevloanguy11
authored andcommitted
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: ab40561 ("igc: Add NVM support") Signed-off-by: Kevin Lo <kevlo@kevlo.org> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 2e99ded commit ebc8d12

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/net/ethernet/intel/igc/igc_i225.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,17 +219,16 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
219219
u16 *data)
220220
{
221221
struct igc_nvm_info *nvm = &hw->nvm;
222+
s32 ret_val = -IGC_ERR_NVM;
222223
u32 attempts = 100000;
223224
u32 i, k, eewr = 0;
224-
s32 ret_val = 0;
225225

226226
/* A check for invalid values: offset too large, too many words,
227227
* too many words for the offset, and not enough words.
228228
*/
229229
if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) ||
230230
words == 0) {
231231
hw_dbg("nvm parameter(s) out of bounds\n");
232-
ret_val = -IGC_ERR_NVM;
233232
goto out;
234233
}
235234

0 commit comments

Comments
 (0)