Skip to contentSkip to conversation

net: stmmac: imx: use stmmac_pltfr_probe()

PATCH Applied Russell King (Oracle) 2 participants 2 messages Apr 14, 2025 – Apr 15, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: stmmac: imx: use stmmac_pltfr_probe()

Using stmmac_pltfr_probe() simplifies the probe function. This will not only call plat_dat->init (imx_dwmac_init), but also plat_dat->exit (imx_dwmac_exit) appropriately if stmmac_dvr_probe() fails. This results in an overall simplification of the glue driver.

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c +2 -12
index 5d279fa54b3e..889e2bb6f7f5 100644
@@ -379,10 +379,6 @@ static int imx_dwmac_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = imx_dwmac_init(pdev, dwmac);
-	if (ret)
-		goto err_dwmac_init;
-
 	if (dwmac->ops->fix_mac_speed) {
 		plat_dat->fix_mac_speed = dwmac->ops->fix_mac_speed;
 	} else if (!dwmac->ops->mac_rgmii_txclk_auto_adj) {
@@ -392,16 +388,10 @@ static int imx_dwmac_probe(struct platform_device *pdev)
 
 	dwmac->plat_dat->fix_soc_reset = dwmac->ops->fix_soc_reset;
 
-	ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
+	ret = stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
 	if (ret)
-		goto err_drv_probe;
-
-	return 0;
+		imx_dwmac_clks_config(dwmac, false);
 
-err_drv_probe:
-	imx_dwmac_exit(pdev, plat_dat->bsp_priv);
-err_dwmac_init:
-	imx_dwmac_clks_config(dwmac, false);
 	return ret;
 }
 
Signature · 1 line
2.30.2
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Mon, 14 Apr 2025 10:06:25 +0100 you wrote:

Using stmmac_pltfr_probe() simplifies the probe function. This will not only call plat_dat->init (imx_dwmac_init), but also plat_dat->exit (imx_dwmac_exit) appropriately if stmmac_dvr_probe() fails. This results in an overall simplification of the glue driver.

[...]

Here is the summary with links:
- [net-next,v2] net: stmmac: imx: use stmmac_pltfr_probe()

    https://git.kernel.org/netdev/net-next/c/b2ee4451c1d4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html