Short-read handling was added to asix_read_cmd() by commit
920a9fa27e78 ("net: asix: add proper error handling of usb read errors").
The helper converts short reads to -ENODATA while preserving negative
errors from the underlying USB read operation.
Remove the redundant short-read check in asix_read_phy_addr()
and its unreachable -EIO assignment. The existing negative-return check
handles both short reads and underlying USB read errors.
Signed-off-by: Xinsheng Zhu <redacted>
---
drivers/net/usb/asix_common.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c
index 4f03f4e57655..51bf887e3520 100644
--- a/drivers/net/usb/asix_common.c
+++ b/drivers/net/usb/asix_common.c
@@ -327,11 +327,6 @@ int asix_read_phy_addr(struct usbnet *dev, bool internal)
if (ret < 0)
goto error;
- if (ret < 2) {
- ret = -EIO;
- goto error;
- }
-
offset = (internal ? 1 : 0);
ret = buf[offset];
base-commit: 014d795c73837ea2339a4ea8e8f82c6e959b845d
--
2.54.0 (Apple Git-157)