]> git.ipfire.org Git - thirdparty/linux.git/commit
net: usb: lan78xx: Improve error handling in EEPROM and OTP operations
authorOleksij Rempel <o.rempel@pengutronix.de>
Wed, 4 Dec 2024 08:41:38 +0000 (09:41 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 7 Dec 2024 01:53:07 +0000 (17:53 -0800)
commit8b1b2ca83b200fa46fdfb81e80ad5fe34537e6d4
treef997f9d739c2d9622292970aa1f9ee5baef70747
parent32ee0dc764505278229078e496e7b56a6d65224b
net: usb: lan78xx: Improve error handling in EEPROM and OTP operations

Refine error handling in EEPROM and OTP read/write functions by:
- Return error values immediately upon detection.
- Avoid overwriting correct error codes with `-EIO`.
- Preserve initial error codes as they were appropriate for specific
  failures.
- Use `-ETIMEDOUT` for timeout conditions instead of `-EIO`.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20241204084142.1152696-7-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/usb/lan78xx.c