summaryrefslogtreecommitdiff
path: root/drivers/net/dsa
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2023-04-03 04:18:04 +0300
committerDavid S. Miller <davem@davemloft.net>2023-04-03 12:13:00 +0300
commit6de2852297737171ba96b91e89bf302ca1fda869 (patch)
treed06d34a2a1cd3554ec3dc0f5cd938a3d2275b636 /drivers/net/dsa
parenta08c045580e060a6886bbb656c50ae20b0c780b5 (diff)
downloadlinux-6de2852297737171ba96b91e89bf302ca1fda869.tar.xz
net: dsa: mt7530: move SGMII PCS creation to mt7530_probe function
Move creating the SGMII PCS from mt753x_setup() to the more appropriate mt7530_probe() function. This is done also in preparation of moving all functions related to MDIO-connected MT753x switches to a separate module. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa')
-rw-r--r--drivers/net/dsa/mt7530.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index a0e1e2e015f0..d285a60aaf68 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -3008,12 +3008,6 @@ mt753x_setup(struct dsa_switch *ds)
if (ret && priv->irq)
mt7530_free_irq_common(priv);
- if (priv->id == ID_MT7531) {
- ret = mt7531_create_sgmii(priv);
- if (ret && priv->irq)
- mt7530_free_irq_common(priv);
- }
-
return ret;
}
@@ -3136,6 +3130,7 @@ mt7530_probe(struct mdio_device *mdiodev)
static struct regmap_config *regmap_config;
struct mt7530_priv *priv;
struct device_node *dn;
+ int ret;
dn = mdiodev->dev.of_node;
@@ -3228,6 +3223,12 @@ mt7530_probe(struct mdio_device *mdiodev)
if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap);
+ if (priv->id == ID_MT7531) {
+ ret = mt7531_create_sgmii(priv);
+ if (ret)
+ return ret;
+ }
+
return dsa_register_switch(priv->ds);
}