diff mbox series

[5/5] net: ch9200: avoid triggering NWay restart on non-zero PHY ID

Message ID 20250412183829.41342-6-qasdev00@gmail.com
State New
Headers show
Series net: ch9200: fix various bugs and improve qinheng ch9200 driver | expand

Commit Message

Qasim Ijaz April 12, 2025, 6:38 p.m. UTC
During ch9200_mdio_read if the phy_id is not 0 -ENODEV is returned.

In certain cases such as in mii_nway_restart returning a negative such
as -ENODEV triggers the "bmcr & BMCR_ANENABLE" check, we should avoid 
this on error and just end the function.

To address this just return 0.

Signed-off-by: Qasim Ijaz <qasdev00@gmail.com> 
---
 drivers/net/usb/ch9200.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/usb/ch9200.c b/drivers/net/usb/ch9200.c
index 187bbfc991f5..281800bb2ff2 100644
--- a/drivers/net/usb/ch9200.c
+++ b/drivers/net/usb/ch9200.c
@@ -182,7 +182,7 @@  static int ch9200_mdio_read(struct net_device *netdev, int phy_id, int loc)
 		   __func__, phy_id, loc);
 
 	if (phy_id != 0)
-		return -ENODEV;
+		return 0;
 
 	ret = control_read(dev, REQUEST_READ, 0, loc * 2, buff, 0x02,
 			   CONTROL_TIMEOUT_MS);