Thread (16 messages) 16 messages, 2 authors, 2021-06-07

Re: [PATCH net-next v1 5/7] net: usb: asix: add error handling for asix_mdio_* functions

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-06-04 23:31:24
Also in: lkml, netdev

quoted hunk ↗ jump to hunk
-void asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
+static int __asix_mdio_write(struct net_device *netdev, int phy_id, int loc,
+			     int val)
 {
 	struct usbnet *dev = netdev_priv(netdev);
 	__le16 res = cpu_to_le16(val);
@@ -517,13 +522,24 @@ void asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
 	} while (!(smsr & AX_HOST_EN) && (i++ < 30) && (ret != -ENODEV));
 	if (ret == -ENODEV) {
 		mutex_unlock(&dev->phy_mutex);
-		return;
+		return ret;
Now that you have added an out: it might be better to use a goto?

Otherwise

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help