mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RFC net-next 17/23] net: dsa: lantiq_gswip: move MDIO bus registration to .setup()
@ 2025-08-16 19:55 Daniel Golle
  0 siblings, 0 replies; only message in thread
From: Daniel Golle @ 2025-08-16 19:55 UTC (permalink / raw)
  To: Andrew Lunn, Vladimir Oltean, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Hauke Mehrtens, Simon Horman,
	Russell King, Florian Fainelli, Arkadi Sharshevsky, linux-kernel,
	netdev
  Cc: Andreas Schirm, Lukas Stockmann, Alexander Sverdlin,
	Peter Christen, Avinash Jayaraman, Bing tao Xu, Liang Xu,
	Juraj Povazanec, Fanni (Fang-Yi) Chan, Benny (Ying-Tsan) Weng,
	Livia M. Rosu, John Crispin

Instead of registering the switch MDIO bus in the probe() function, move
the call to gswip_mdio() into the .setup() DSA switch op, so it can be
reused independently of the probe() function.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/net/dsa/lantiq_gswip.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
index 4641068d711b..6a263a0387d1 100644
--- a/drivers/net/dsa/lantiq_gswip.c
+++ b/drivers/net/dsa/lantiq_gswip.c
@@ -677,6 +677,13 @@ static int gswip_setup(struct dsa_switch *ds)
 	/* Configure the MDIO Clock 2.5 MHz */
 	gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1);
 
+	/* bring up the mdio bus */
+	err = gswip_mdio(priv);
+	if (err) {
+		dev_err(priv->dev, "mdio bus setup failed\n");
+		return err;
+	}
+
 	/* Disable the xMII interface and clear it's isolation bit */
 	for (i = 0; i < priv->hw_info->max_ports; i++)
 		gswip_mii_mask_cfg(priv,
@@ -2093,13 +2100,6 @@ static int gswip_probe(struct platform_device *pdev)
 					     "gphy fw probe failed\n");
 	}
 
-	/* bring up the mdio bus */
-	err = gswip_mdio(priv);
-	if (err) {
-		dev_err_probe(dev, err, "mdio probe failed\n");
-		goto gphy_fw_remove;
-	}
-
 	err = gswip_allocate_vlans(priv);
 	if (err)
 		goto gphy_fw_remove;
-- 
2.50.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-08-16 19:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-16 19:55 [PATCH RFC net-next 17/23] net: dsa: lantiq_gswip: move MDIO bus registration to .setup() Daniel Golle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®