1 From 6de2852297737171ba96b91e89bf302ca1fda869 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Mon, 3 Apr 2023 02:18:04 +0100
4 Subject: [PATCH 08/16] net: dsa: mt7530: move SGMII PCS creation to
7 Move creating the SGMII PCS from mt753x_setup() to the more appropriate
8 mt7530_probe() function.
9 This is done also in preparation of moving all functions related to
10 MDIO-connected MT753x switches to a separate module.
12 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
13 Reviewed-by: Andrew Lunn <andrew@lunn.ch>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
16 drivers/net/dsa/mt7530.c | 13 +++++++------
17 1 file changed, 7 insertions(+), 6 deletions(-)
19 --- a/drivers/net/dsa/mt7530.c
20 +++ b/drivers/net/dsa/mt7530.c
21 @@ -3007,12 +3007,6 @@ mt753x_setup(struct dsa_switch *ds)
23 mt7530_free_irq_common(priv);
25 - if (priv->id == ID_MT7531) {
26 - ret = mt7531_create_sgmii(priv);
27 - if (ret && priv->irq)
28 - mt7530_free_irq_common(priv);
34 @@ -3129,6 +3123,7 @@ mt7530_probe(struct mdio_device *mdiodev
35 static struct regmap_config *regmap_config;
36 struct mt7530_priv *priv;
37 struct device_node *dn;
40 dn = mdiodev->dev.of_node;
42 @@ -3221,6 +3216,12 @@ mt7530_probe(struct mdio_device *mdiodev
43 if (IS_ERR(priv->regmap))
44 return PTR_ERR(priv->regmap);
46 + if (priv->id == ID_MT7531) {
47 + ret = mt7531_create_sgmii(priv);
52 return dsa_register_switch(priv->ds);