mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 05:32:00 +00:00
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>
This commit is contained in:
parent
40db9f1ddf
commit
3d5bf75d76
@ -734,6 +734,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
|
||||
|
@ -24,6 +24,9 @@ int stmmac_pltfr_init(struct platform_device *pdev,
|
||||
void stmmac_pltfr_exit(struct platform_device *pdev,
|
||||
struct plat_stmmacenet_data *plat);
|
||||
|
||||
int stmmac_pltfr_probe(struct platform_device *pdev,
|
||||
struct plat_stmmacenet_data *plat,
|
||||
struct stmmac_resources *res);
|
||||
void stmmac_pltfr_remove(struct platform_device *pdev);
|
||||
extern const struct dev_pm_ops stmmac_pltfr_pm_ops;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user