]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: socfpga: convert to devm_stmmac_pltfr_probe()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 17 Apr 2025 17:13:32 +0000 (18:13 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 22 Apr 2025 01:47:57 +0000 (18:47 -0700)
Convert socfpga to use devm_stmmac_pltfr_probe() to further simplify
the probe function, wrapping the call to the set_phy_mode() method
into socfpga_dwmac_init() which can be called from the plat_dat->init()
method. Also call this from socfpga_dwmac_resume() thereby simplifying
that function.

Using the devm variant also means we can remove the call to
stmmac_pltfr_remove().

Unfortunately, we can't also convert to stmmac_pltfr_pm_ops as there is
extra work done in socfpga_dwmac_resume().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/E1u5Sns-001IJw-OY@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c

index c7c120e302974c19dce5730484ea706bbe785a46..59f90b123c5b8f02ec724d90c0df5136eb1bf715 100644 (file)
@@ -500,11 +500,7 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
 
        plat_dat->riwt_off = 1;
 
-       ret = socfpga_dwmac_init(pdev, dwmac);
-       if (ret)
-               return ret;
-
-       return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
+       return devm_stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
 }
 
 static const struct socfpga_dwmac_ops socfpga_gen5_ops = {
@@ -524,7 +520,6 @@ MODULE_DEVICE_TABLE(of, socfpga_dwmac_match);
 
 static struct platform_driver socfpga_dwmac_driver = {
        .probe  = socfpga_dwmac_probe,
-       .remove = stmmac_pltfr_remove,
        .driver = {
                .name           = "socfpga-dwmac",
                .pm             = &stmmac_pltfr_pm_ops,