2023-04-30 13:32:03 +00:00
|
|
|
From 6de2852297737171ba96b91e89bf302ca1fda869 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Daniel Golle <daniel@makrotopia.org>
|
|
|
|
Date: Mon, 3 Apr 2023 02:18:04 +0100
|
|
|
|
Subject: [PATCH 08/16] 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>
|
|
|
|
---
|
|
|
|
drivers/net/dsa/mt7530.c | 13 +++++++------
|
|
|
|
1 file changed, 7 insertions(+), 6 deletions(-)
|
|
|
|
|
|
|
|
--- a/drivers/net/dsa/mt7530.c
|
|
|
|
+++ b/drivers/net/dsa/mt7530.c
|
2024-04-28 19:35:55 +00:00
|
|
|
@@ -3265,12 +3265,6 @@ mt753x_setup(struct dsa_switch *ds)
|
2023-04-30 13:32:03 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2024-04-28 19:35:55 +00:00
|
|
|
@@ -3388,6 +3382,7 @@ mt7530_probe(struct mdio_device *mdiodev
|
2023-04-30 13:32:03 +00:00
|
|
|
static struct regmap_config *regmap_config;
|
|
|
|
struct mt7530_priv *priv;
|
|
|
|
struct device_node *dn;
|
|
|
|
+ int ret;
|
|
|
|
|
|
|
|
dn = mdiodev->dev.of_node;
|
|
|
|
|
2024-04-28 19:35:55 +00:00
|
|
|
@@ -3480,6 +3475,12 @@ mt7530_probe(struct mdio_device *mdiodev
|
2023-04-30 13:32:03 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|