From: Kevin Lo <kevlo@kevlo.org>
To: Sasha Neftin <sasha.neftin@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: "David S . Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: [PATCH] igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr
Date: Fri, 11 Dec 2020 22:34:56 +0800 [thread overview]
Message-ID: <20201211143456.GA83809@ns.kevlo.org> (raw)
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.
Signed-off-by: Kevin Lo <kevlo@kevlo.org>
---
diff --git a/drivers/net/ethernet/intel/igc/igc_i225.c b/drivers/net/ethernet/intel/igc/igc_i225.c
index 8b67d9b49a83..b0a5cd31683e 100644
--- a/drivers/net/ethernet/intel/igc/igc_i225.c
+++ b/drivers/net/ethernet/intel/igc/igc_i225.c
@@ -221,7 +221,7 @@ static s32 igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
struct igc_nvm_info *nvm = &hw->nvm;
u32 attempts = 100000;
u32 i, k, eewr = 0;
- s32 ret_val = 0;
+ s32 ret_val = -IGC_ERR_NVM;
/* 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;
}
next reply other threads:[~2020-12-11 15:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-11 14:34 Kevin Lo [this message]
2020-12-12 22:00 ` [PATCH] igc: set the default return value to -IGC_ERR_NVM in igc_write_nvm_srwr Jakub Kicinski
2020-12-14 1:21 ` Kevin Lo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201211143456.GA83809@ns.kevlo.org \
--to=kevlo@kevlo.org \
--cc=davem@davemloft.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=netdev@vger.kernel.org \
--cc=sasha.neftin@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).