diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2017-11-22 11:22:27 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-11-24 10:06:14 +0100 |
commit | eed09e73f335dc4ceb809a783b6be3fe78225257 (patch) | |
tree | 587ac977d829171fb3d4478e90ba00ba1d506775 /drivers/net/e1000 | |
parent | 162ee2c8c9fc2cfd7351505be4d595e620f9ec28 (diff) | |
download | barebox-eed09e73f335dc4ceb809a783b6be3fe78225257.tar.gz barebox-eed09e73f335dc4ceb809a783b6be3fe78225257.tar.xz |
net/e1000: don't use the eeprom word size as timeout to get a semaphore
Nothing in the documentation suggests that the time to get a semaphore
depends on the size of the (optional) eeprom and I doubt there is a
relation. Given that 2048 is the maximal value for word_size unless a
flash is used to emulate the eeprom, pick 2049 as alternative arbitrary
value that probably doesn't result in regressions.
This drops the only user of ->word_size outside of eeprom.c which allows
easier restructurings there in the future.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r-- | drivers/net/e1000/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/e1000/main.c b/drivers/net/e1000/main.c index 6491623104..01c9f39a25 100644 --- a/drivers/net/e1000/main.c +++ b/drivers/net/e1000/main.c @@ -142,7 +142,7 @@ static int32_t e1000_set_phy_mode(struct e1000_hw *hw) ***************************************************************************/ static int32_t e1000_get_software_semaphore(struct e1000_hw *hw) { - int32_t timeout = hw->eeprom.word_size + 1; + int32_t timeout = 2049; uint32_t swsm; DEBUGFUNC(); @@ -214,7 +214,7 @@ static int32_t e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) } /* Get the FW semaphore. */ - timeout = hw->eeprom.word_size + 1; + timeout = 2049; while (timeout) { swsm = e1000_read_reg(hw, E1000_SWSM); swsm |= E1000_SWSM_SWESMBI; |