From: Daniel Golle Date: Sat, 30 Aug 2025 02:34:48 +0000 (+0100) Subject: net: dsa: lantiq_gswip: move MDIO bus registration to .setup() X-Git-Tag: v6.18-rc1~132^2~273^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0dc602a3c7f781c8358e00d14988eca32d5e95c1;p=thirdparty%2Fkernel%2Fstable.git net: dsa: lantiq_gswip: move MDIO bus registration to .setup() 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 Reviewed-by: Andrew Lunn Reviewed-by: Hauke Mehrtens Link: https://patch.msgid.link/2650602042c0bfdc5664b88d59071ed4dca96c26.1756520811.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/dsa/lantiq/lantiq_gswip.c b/drivers/net/dsa/lantiq/lantiq_gswip.c index 43f83c0736d1d..1e991d7bca0bb 100644 --- a/drivers/net/dsa/lantiq/lantiq_gswip.c +++ b/drivers/net/dsa/lantiq/lantiq_gswip.c @@ -627,6 +627,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, @@ -1973,13 +1980,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 = dsa_register_switch(priv->ds); if (err) { dev_err_probe(dev, err, "dsa switch registration failed\n");