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