Skip to content

Commit 1dbefd5

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: socfpga: convert to devm_stmmac_pltfr_probe()
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) <[email protected]> Tested-by: Maxime Chevallier <[email protected]> Reviewed-by: Maxime Chevallier <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9125534 commit 1dbefd5

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,11 +500,7 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
500500

501501
plat_dat->riwt_off = 1;
502502

503-
ret = socfpga_dwmac_init(pdev, dwmac);
504-
if (ret)
505-
return ret;
506-
507-
return stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
503+
return devm_stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
508504
}
509505

510506
static const struct socfpga_dwmac_ops socfpga_gen5_ops = {
@@ -524,7 +520,6 @@ MODULE_DEVICE_TABLE(of, socfpga_dwmac_match);
524520

525521
static struct platform_driver socfpga_dwmac_driver = {
526522
.probe = socfpga_dwmac_probe,
527-
.remove = stmmac_pltfr_remove,
528523
.driver = {
529524
.name = "socfpga-dwmac",
530525
.pm = &stmmac_pltfr_pm_ops,

0 commit comments

Comments
 (0)