Commit 6de28522 authored by Daniel Golle's avatar Daniel Golle Committed by David S. Miller

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: default avatarDaniel Golle <daniel@makrotopia.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a08c0455
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment