mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
Merge branch 'net-stmmac-convert-to-platform-remove-callback-returning-void'
Uwe Kleine-König says:
====================
net: stmmac: Convert to platform remove callback returning void
(implicit) v1 of this series is available at
https://lore.kernel.org/netdev/20230402143025.2524443-1-u.kleine-koenig@pengutronix.de
Changes since then:
- Added various Reviewed-by: and Acked-by: tags received for v1
- Removed a variable in an earlier patch to make all intermediate steps
compilable, spotted by Simon Horman
- Rebased to v6.4-rc1 (which needed a slight adaption to cope for
4bd3bb7b45
("net: stmmac: Add glue layer for StarFive JH7110 SoC"))
====================
Link: https://lore.kernel.org/r/20230508142637.1449363-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
341d3bda8c
24 changed files with 41 additions and 77 deletions
|
@ -141,7 +141,7 @@ MODULE_DEVICE_TABLE(of, anarion_dwmac_match);
|
|||
|
||||
static struct platform_driver anarion_dwmac_driver = {
|
||||
.probe = anarion_dwmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "anarion-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -464,7 +464,7 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int dwc_eth_dwmac_remove(struct platform_device *pdev)
|
||||
static void dwc_eth_dwmac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct stmmac_priv *priv = netdev_priv(ndev);
|
||||
|
@ -477,8 +477,6 @@ static int dwc_eth_dwmac_remove(struct platform_device *pdev)
|
|||
data->remove(pdev);
|
||||
|
||||
stmmac_remove_config_dt(pdev, priv->plat);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id dwc_eth_dwmac_match[] = {
|
||||
|
@ -490,7 +488,7 @@ MODULE_DEVICE_TABLE(of, dwc_eth_dwmac_match);
|
|||
|
||||
static struct platform_driver dwc_eth_dwmac_driver = {
|
||||
.probe = dwc_eth_dwmac_probe,
|
||||
.remove = dwc_eth_dwmac_remove,
|
||||
.remove_new = dwc_eth_dwmac_remove,
|
||||
.driver = {
|
||||
.name = "dwc-eth-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -87,7 +87,7 @@ MODULE_DEVICE_TABLE(of, dwmac_generic_match);
|
|||
|
||||
static struct platform_driver dwmac_generic_driver = {
|
||||
.probe = dwmac_generic_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = STMMAC_RESOURCE_NAME,
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -376,7 +376,7 @@ MODULE_DEVICE_TABLE(of, imx_dwmac_match);
|
|||
|
||||
static struct platform_driver imx_dwmac_driver = {
|
||||
.probe = imx_dwmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "imx-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -386,7 +386,7 @@ MODULE_DEVICE_TABLE(of, ingenic_mac_of_matches);
|
|||
|
||||
static struct platform_driver ingenic_mac_driver = {
|
||||
.probe = ingenic_mac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "ingenic-mac",
|
||||
.pm = pm_ptr(&ingenic_mac_pm_ops),
|
||||
|
|
|
@ -169,20 +169,17 @@ static int intel_eth_plat_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int intel_eth_plat_remove(struct platform_device *pdev)
|
||||
static void intel_eth_plat_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct intel_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev);
|
||||
int ret;
|
||||
|
||||
ret = stmmac_pltfr_remove(pdev);
|
||||
stmmac_pltfr_remove(pdev);
|
||||
clk_disable_unprepare(dwmac->tx_clk);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver intel_eth_plat_driver = {
|
||||
.probe = intel_eth_plat_probe,
|
||||
.remove = intel_eth_plat_remove,
|
||||
.remove_new = intel_eth_plat_remove,
|
||||
.driver = {
|
||||
.name = "intel-eth-plat",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -498,7 +498,7 @@ MODULE_DEVICE_TABLE(of, ipq806x_gmac_dwmac_match);
|
|||
|
||||
static struct platform_driver ipq806x_gmac_dwmac_driver = {
|
||||
.probe = ipq806x_gmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "ipq806x-gmac-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -83,7 +83,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_dwmac_match);
|
|||
|
||||
static struct platform_driver lpc18xx_dwmac_driver = {
|
||||
.probe = lpc18xx_dwmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "lpc18xx-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -678,15 +678,12 @@ static int mediatek_dwmac_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int mediatek_dwmac_remove(struct platform_device *pdev)
|
||||
static void mediatek_dwmac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mediatek_dwmac_plat_data *priv_plat = get_stmmac_bsp_priv(&pdev->dev);
|
||||
int ret;
|
||||
|
||||
ret = stmmac_pltfr_remove(pdev);
|
||||
stmmac_pltfr_remove(pdev);
|
||||
mediatek_dwmac_clks_config(priv_plat, false);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct of_device_id mediatek_dwmac_match[] = {
|
||||
|
@ -701,7 +698,7 @@ MODULE_DEVICE_TABLE(of, mediatek_dwmac_match);
|
|||
|
||||
static struct platform_driver mediatek_dwmac_driver = {
|
||||
.probe = mediatek_dwmac_probe,
|
||||
.remove = mediatek_dwmac_remove,
|
||||
.remove_new = mediatek_dwmac_remove,
|
||||
.driver = {
|
||||
.name = "dwmac-mediatek",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -91,7 +91,7 @@ MODULE_DEVICE_TABLE(of, meson6_dwmac_match);
|
|||
|
||||
static struct platform_driver meson6_dwmac_driver = {
|
||||
.probe = meson6_dwmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "meson6-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -539,7 +539,7 @@ MODULE_DEVICE_TABLE(of, meson8b_dwmac_match);
|
|||
|
||||
static struct platform_driver meson8b_dwmac_driver = {
|
||||
.probe = meson8b_dwmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "meson8b-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -231,7 +231,7 @@ MODULE_DEVICE_TABLE(of, oxnas_dwmac_match);
|
|||
|
||||
static struct platform_driver oxnas_dwmac_driver = {
|
||||
.probe = oxnas_dwmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "oxnas-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -665,19 +665,12 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int qcom_ethqos_remove(struct platform_device *pdev)
|
||||
static void qcom_ethqos_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct qcom_ethqos *ethqos;
|
||||
int ret;
|
||||
struct qcom_ethqos *ethqos = get_stmmac_bsp_priv(&pdev->dev);
|
||||
|
||||
ethqos = get_stmmac_bsp_priv(&pdev->dev);
|
||||
if (!ethqos)
|
||||
return -ENODEV;
|
||||
|
||||
ret = stmmac_pltfr_remove(pdev);
|
||||
stmmac_pltfr_remove(pdev);
|
||||
ethqos_clks_config(ethqos, false);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct of_device_id qcom_ethqos_match[] = {
|
||||
|
@ -690,7 +683,7 @@ MODULE_DEVICE_TABLE(of, qcom_ethqos_match);
|
|||
|
||||
static struct platform_driver qcom_ethqos_driver = {
|
||||
.probe = qcom_ethqos_probe,
|
||||
.remove = qcom_ethqos_remove,
|
||||
.remove_new = qcom_ethqos_remove,
|
||||
.driver = {
|
||||
.name = "qcom-ethqos",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -1863,15 +1863,13 @@ static int rk_gmac_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int rk_gmac_remove(struct platform_device *pdev)
|
||||
static void rk_gmac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(&pdev->dev);
|
||||
|
||||
stmmac_dvr_remove(&pdev->dev);
|
||||
|
||||
rk_gmac_powerdown(bsp_priv);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -1925,7 +1923,7 @@ MODULE_DEVICE_TABLE(of, rk_gmac_dwmac_match);
|
|||
|
||||
static struct platform_driver rk_gmac_dwmac_driver = {
|
||||
.probe = rk_gmac_probe,
|
||||
.remove = rk_gmac_remove,
|
||||
.remove_new = rk_gmac_remove,
|
||||
.driver = {
|
||||
.name = "rk_gmac-dwmac",
|
||||
.pm = &rk_gmac_pm_ops,
|
||||
|
|
|
@ -524,7 +524,7 @@ MODULE_DEVICE_TABLE(of, socfpga_dwmac_match);
|
|||
|
||||
static struct platform_driver socfpga_dwmac_driver = {
|
||||
.probe = socfpga_dwmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "socfpga-dwmac",
|
||||
.pm = &socfpga_dwmac_pm_ops,
|
||||
|
|
|
@ -156,7 +156,7 @@ MODULE_DEVICE_TABLE(of, starfive_dwmac_match);
|
|||
|
||||
static struct platform_driver starfive_dwmac_driver = {
|
||||
.probe = starfive_dwmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "starfive-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -317,15 +317,13 @@ static int sti_dwmac_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int sti_dwmac_remove(struct platform_device *pdev)
|
||||
static void sti_dwmac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct sti_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev);
|
||||
|
||||
stmmac_dvr_remove(&pdev->dev);
|
||||
|
||||
clk_disable_unprepare(dwmac->clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
|
@ -365,7 +363,7 @@ MODULE_DEVICE_TABLE(of, sti_dwmac_match);
|
|||
|
||||
static struct platform_driver sti_dwmac_driver = {
|
||||
.probe = sti_dwmac_probe,
|
||||
.remove = sti_dwmac_remove,
|
||||
.remove_new = sti_dwmac_remove,
|
||||
.driver = {
|
||||
.name = "sti-dwmac",
|
||||
.pm = &sti_dwmac_pm_ops,
|
||||
|
|
|
@ -417,7 +417,7 @@ static int stm32_dwmac_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int stm32_dwmac_remove(struct platform_device *pdev)
|
||||
static void stm32_dwmac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct stmmac_priv *priv = netdev_priv(ndev);
|
||||
|
@ -431,8 +431,6 @@ static int stm32_dwmac_remove(struct platform_device *pdev)
|
|||
dev_pm_clear_wake_irq(&pdev->dev);
|
||||
device_init_wakeup(&pdev->dev, false);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int stm32mp1_suspend(struct stm32_dwmac *dwmac)
|
||||
|
@ -528,7 +526,7 @@ MODULE_DEVICE_TABLE(of, stm32_dwmac_match);
|
|||
|
||||
static struct platform_driver stm32_dwmac_driver = {
|
||||
.probe = stm32_dwmac_probe,
|
||||
.remove = stm32_dwmac_remove,
|
||||
.remove_new = stm32_dwmac_remove,
|
||||
.driver = {
|
||||
.name = "stm32-dwmac",
|
||||
.pm = &stm32_dwmac_pm_ops,
|
||||
|
|
|
@ -1294,7 +1294,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int sun8i_dwmac_remove(struct platform_device *pdev)
|
||||
static void sun8i_dwmac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct stmmac_priv *priv = netdev_priv(ndev);
|
||||
|
@ -1309,8 +1309,6 @@ static int sun8i_dwmac_remove(struct platform_device *pdev)
|
|||
|
||||
stmmac_pltfr_remove(pdev);
|
||||
sun8i_dwmac_unset_syscon(gmac);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void sun8i_dwmac_shutdown(struct platform_device *pdev)
|
||||
|
@ -1341,7 +1339,7 @@ MODULE_DEVICE_TABLE(of, sun8i_dwmac_match);
|
|||
|
||||
static struct platform_driver sun8i_dwmac_driver = {
|
||||
.probe = sun8i_dwmac_probe,
|
||||
.remove = sun8i_dwmac_remove,
|
||||
.remove_new = sun8i_dwmac_remove,
|
||||
.shutdown = sun8i_dwmac_shutdown,
|
||||
.driver = {
|
||||
.name = "dwmac-sun8i",
|
||||
|
|
|
@ -179,7 +179,7 @@ MODULE_DEVICE_TABLE(of, sun7i_dwmac_match);
|
|||
|
||||
static struct platform_driver sun7i_dwmac_driver = {
|
||||
.probe = sun7i_gmac_probe,
|
||||
.remove = stmmac_pltfr_remove,
|
||||
.remove_new = stmmac_pltfr_remove,
|
||||
.driver = {
|
||||
.name = "sun7i-dwmac",
|
||||
.pm = &stmmac_pltfr_pm_ops,
|
||||
|
|
|
@ -353,15 +353,13 @@ static int tegra_mgbe_probe(struct platform_device *pdev)
|
|||
return err;
|
||||
}
|
||||
|
||||
static int tegra_mgbe_remove(struct platform_device *pdev)
|
||||
static void tegra_mgbe_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct tegra_mgbe *mgbe = get_stmmac_bsp_priv(&pdev->dev);
|
||||
|
||||
clk_bulk_disable_unprepare(ARRAY_SIZE(mgbe_clks), mgbe->clks);
|
||||
|
||||
stmmac_pltfr_remove(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id tegra_mgbe_match[] = {
|
||||
|
@ -374,7 +372,7 @@ static SIMPLE_DEV_PM_OPS(tegra_mgbe_pm_ops, tegra_mgbe_suspend, tegra_mgbe_resum
|
|||
|
||||
static struct platform_driver tegra_mgbe_driver = {
|
||||
.probe = tegra_mgbe_probe,
|
||||
.remove = tegra_mgbe_remove,
|
||||
.remove_new = tegra_mgbe_remove,
|
||||
.driver = {
|
||||
.name = "tegra-mgbe",
|
||||
.pm = &tegra_mgbe_pm_ops,
|
||||
|
|
|
@ -198,7 +198,7 @@ static int visconti_eth_clock_probe(struct platform_device *pdev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int visconti_eth_clock_remove(struct platform_device *pdev)
|
||||
static void visconti_eth_clock_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct visconti_eth *dwmac = get_stmmac_bsp_priv(&pdev->dev);
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
|
@ -206,8 +206,6 @@ static int visconti_eth_clock_remove(struct platform_device *pdev)
|
|||
|
||||
clk_disable_unprepare(dwmac->phy_ref_clk);
|
||||
clk_disable_unprepare(priv->plat->stmmac_clk);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int visconti_eth_dwmac_probe(struct platform_device *pdev)
|
||||
|
@ -259,23 +257,16 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int visconti_eth_dwmac_remove(struct platform_device *pdev)
|
||||
static void visconti_eth_dwmac_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct stmmac_priv *priv = netdev_priv(ndev);
|
||||
int err;
|
||||
|
||||
err = stmmac_pltfr_remove(pdev);
|
||||
if (err < 0)
|
||||
dev_err(&pdev->dev, "failed to remove platform: %d\n", err);
|
||||
stmmac_pltfr_remove(pdev);
|
||||
|
||||
err = visconti_eth_clock_remove(pdev);
|
||||
if (err < 0)
|
||||
dev_err(&pdev->dev, "failed to remove clock: %d\n", err);
|
||||
visconti_eth_clock_remove(pdev);
|
||||
|
||||
stmmac_remove_config_dt(pdev, priv->plat);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static const struct of_device_id visconti_eth_dwmac_match[] = {
|
||||
|
@ -286,7 +277,7 @@ MODULE_DEVICE_TABLE(of, visconti_eth_dwmac_match);
|
|||
|
||||
static struct platform_driver visconti_eth_dwmac_driver = {
|
||||
.probe = visconti_eth_dwmac_probe,
|
||||
.remove = visconti_eth_dwmac_remove,
|
||||
.remove_new = visconti_eth_dwmac_remove,
|
||||
.driver = {
|
||||
.name = "visconti-eth-dwmac",
|
||||
.of_match_table = visconti_eth_dwmac_match,
|
||||
|
|
|
@ -707,7 +707,7 @@ EXPORT_SYMBOL_GPL(stmmac_get_platform_resources);
|
|||
* Description: this function calls the main to free the net resources
|
||||
* and calls the platforms hook and release the resources (e.g. mem).
|
||||
*/
|
||||
int stmmac_pltfr_remove(struct platform_device *pdev)
|
||||
void stmmac_pltfr_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct stmmac_priv *priv = netdev_priv(ndev);
|
||||
|
@ -719,8 +719,6 @@ int stmmac_pltfr_remove(struct platform_device *pdev)
|
|||
plat->exit(pdev, plat->bsp_priv);
|
||||
|
||||
stmmac_remove_config_dt(pdev, plat);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ void stmmac_remove_config_dt(struct platform_device *pdev,
|
|||
int stmmac_get_platform_resources(struct platform_device *pdev,
|
||||
struct stmmac_resources *stmmac_res);
|
||||
|
||||
int stmmac_pltfr_remove(struct platform_device *pdev);
|
||||
void stmmac_pltfr_remove(struct platform_device *pdev);
|
||||
extern const struct dev_pm_ops stmmac_pltfr_pm_ops;
|
||||
|
||||
static inline void *get_stmmac_bsp_priv(struct device *dev)
|
||||
|
|
Loading…
Reference in a new issue