Thread (13 messages) 13 messages, 3 authors, 9d ago

Re: [PATCH net-next v13 5/5] net: dsa: motorcomm: Add support for Motorcomm YT922x

flat view

From: Andrew Lunn <andrew@lunn.ch>
Date: 2026-10-12 14:47:50
Also in: lkml

quoted hunk ↗ jump to hunk
 static int yt921x_chip_detect(struct yt921x_priv *priv)
 {
 	struct device *dev = yt921x_priv_to_device(priv);
@@ -3631,6 +3648,9 @@ static int yt921x_chip_detect(struct yt921x_priv *priv)
 		return -ENODEV;
 	}
 
+	if (!yt921x_needs_extmode_check(major))
+		goto skip_extmode_check;
+
 	res = yt921x_reg_read(priv, YT921X_CHIP_MODE, &mode);
 	if (res)
 		return res;
@@ -3670,6 +3690,14 @@ static int yt921x_chip_detect(struct yt921x_priv *priv)
 
 	priv->info = info;
 
+	return 0;
+
+skip_extmode_check:
+	dev_info(dev,
+		 "Motorcomm %s ethernet switch, chipid: 0x%x\n",
+		 info->name, chipid);
+	priv->info = info;
+
This goto is a bit spaghetti like coding. Why not:

	if (!yt921x_needs_extmode_check(major))
		dev_info(dev,
			 "Motorcomm %s ethernet switch, chipid: 0x%x\n",
			  info->name, chipid);
		priv->info = info;

		return 0;

	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