aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>2023-06-23 12:04:11 +0200
committerJakub Kicinski <kuba@kernel.org>2023-06-24 15:35:59 -0700
commit3d5bf75d76ea8c6bfcffd1b6aa76686d86f9ea34 (patch)
tree1959523d412c7fa35317dc797afc6044748942f8 /drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
parentnet: stmmac: dwmac-generic: use stmmac_pltfr_exit() (diff)
downloadwireguard-linux-3d5bf75d76ea8c6bfcffd1b6aa76686d86f9ea34.tar.xz
wireguard-linux-3d5bf75d76ea8c6bfcffd1b6aa76686d86f9ea34.zip
net: stmmac: platform: provide stmmac_pltfr_probe()
Implement stmmac_pltfr_probe() which is the logical API counterpart for stmmac_pltfr_remove(). It calls the platform's init() callback and then probes the stmmac device. Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: https://lore.kernel.org/r/20230623100417.93592-6-brgl@bgdev.pl Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 5b2bc129cd85..df417cdab8c1 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -735,6 +735,34 @@ void stmmac_pltfr_exit(struct platform_device *pdev,
EXPORT_SYMBOL_GPL(stmmac_pltfr_exit);
/**
+ * stmmac_pltfr_probe
+ * @pdev: platform device pointer
+ * @plat: driver data platform structure
+ * @res: stmmac resources structure
+ * Description: This calls the platform's init() callback and probes the
+ * stmmac driver.
+ */
+int stmmac_pltfr_probe(struct platform_device *pdev,
+ struct plat_stmmacenet_data *plat,
+ struct stmmac_resources *res)
+{
+ int ret;
+
+ ret = stmmac_pltfr_init(pdev, plat);
+ if (ret)
+ return ret;
+
+ ret = stmmac_dvr_probe(&pdev->dev, plat, res);
+ if (ret) {
+ stmmac_pltfr_exit(pdev, plat);
+ return ret;
+ }
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(stmmac_pltfr_probe);
+
+/**
* stmmac_pltfr_remove
* @pdev: platform device pointer
* Description: this function calls the main to free the net resources