net: stmmac: dwmac-generic: use stmmac_pltfr_init()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 23 Jun 2023 10:04:08 +0000 (12:04 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 24 Jun 2023 22:35:59 +0000 (15:35 -0700)
Shrink the code in dwmac-generic by using the new stmmac_pltfr_init()
helper.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Link: https://lore.kernel.org/r/20230623100417.93592-3-brgl@bgdev.pl
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c

index ef10239..b7fc798 100644 (file)
@@ -47,11 +47,9 @@ static int dwmac_generic_probe(struct platform_device *pdev)
        }
 
        /* Custom initialisation (if needed) */
-       if (plat_dat->init) {
-               ret = plat_dat->init(pdev, plat_dat->bsp_priv);
-               if (ret)
-                       goto err_remove_config_dt;
-       }
+       ret = stmmac_pltfr_init(pdev, plat_dat);
+       if (ret)
+               goto err_remove_config_dt;
 
        ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
        if (ret)