mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-27 22:13:55 -04:00
et131x: propagate EEPROM readiness errors
eeprom_wait_ready() returns a negative error when the LBCIF status cannot be read or the device does not become ready for some other reason. eeprom_write() propagates this error before starting a write, but currently returns 0 when the same readiness check fails after the write begins. This behavior was introduced when the EEPROM code was refactored to use Linux error-return conventions (from 0 = failure to 0 = success). Return the error so callers do not treat a failed EEPROM write as successful and the function contract is maintained. Cc: stable+noautosel@kernel.org # untested fix to unlikely driver error path Signed-off-by: Avi Weiss <thnkslprpt@gmail.com> Acked-by: Mark Einon <mark.einon@gmail.com> Link: https://patch.msgid.link/20260808194347.813242-1-thnkslprpt@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
20232e99e8
commit
341d8aff93
@@ -567,7 +567,7 @@ static int eeprom_write(struct et131x_adapter *adapter, u32 addr, u8 data)
|
||||
*/
|
||||
err = eeprom_wait_ready(pdev, &status);
|
||||
if (err < 0)
|
||||
return 0;
|
||||
return err;
|
||||
|
||||
/* Check bit 3 of the LBCIF Status Register. If equal to 1,
|
||||
* an error has occurred.Don't break here if we are revision
|
||||
|
||||
Reference in New Issue
Block a user