Skip to content

Commit

Permalink
net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove
Browse files Browse the repository at this point in the history
Now, all users of the old stmmac_pltfr_remove() are converted to the
devres helper, it's time to rename stmmac_pltfr_remove_no_dt() back to
stmmac_pltfr_remove() and remove the old stmmac_pltfr_remove().

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jisheng Zhang authored and David S. Miller committed Sep 18, 2023
1 parent d336a11 commit 2c9fc83
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 37 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ MODULE_DEVICE_TABLE(of, anarion_dwmac_match);

static struct platform_driver anarion_dwmac_driver = {
.probe = anarion_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt,
.remove_new = stmmac_pltfr_remove,
.driver = {
.name = "anarion-dwmac",
.pm = &stmmac_pltfr_pm_ops,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ MODULE_DEVICE_TABLE(of, imx_dwmac_match);

static struct platform_driver imx_dwmac_driver = {
.probe = imx_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt,
.remove_new = stmmac_pltfr_remove,
.driver = {
.name = "imx-dwmac",
.pm = &stmmac_pltfr_pm_ops,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ MODULE_DEVICE_TABLE(of, ingenic_mac_of_matches);

static struct platform_driver ingenic_mac_driver = {
.probe = ingenic_mac_probe,
.remove_new = stmmac_pltfr_remove_no_dt,
.remove_new = stmmac_pltfr_remove,
.driver = {
.name = "ingenic-mac",
.pm = pm_ptr(&ingenic_mac_pm_ops),
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-intel-plat.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static void intel_eth_plat_remove(struct platform_device *pdev)
{
struct intel_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev);

stmmac_pltfr_remove_no_dt(pdev);
stmmac_pltfr_remove(pdev);
clk_disable_unprepare(dwmac->tx_clk);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-ipq806x.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ MODULE_DEVICE_TABLE(of, ipq806x_gmac_dwmac_match);

static struct platform_driver ipq806x_gmac_dwmac_driver = {
.probe = ipq806x_gmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt,
.remove_new = stmmac_pltfr_remove,
.driver = {
.name = "ipq806x-gmac-dwmac",
.pm = &stmmac_pltfr_pm_ops,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-lpc18xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_dwmac_match);

static struct platform_driver lpc18xx_dwmac_driver = {
.probe = lpc18xx_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt,
.remove_new = stmmac_pltfr_remove,
.driver = {
.name = "lpc18xx-dwmac",
.pm = &stmmac_pltfr_pm_ops,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ static void mediatek_dwmac_remove(struct platform_device *pdev)
{
struct mediatek_dwmac_plat_data *priv_plat = get_stmmac_bsp_priv(&pdev->dev);

stmmac_pltfr_remove_no_dt(pdev);
stmmac_pltfr_remove(pdev);
mediatek_dwmac_clks_config(priv_plat, false);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-meson.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ MODULE_DEVICE_TABLE(of, meson6_dwmac_match);

static struct platform_driver meson6_dwmac_driver = {
.probe = meson6_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt,
.remove_new = stmmac_pltfr_remove,
.driver = {
.name = "meson6-dwmac",
.pm = &stmmac_pltfr_pm_ops,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ MODULE_DEVICE_TABLE(of, meson8b_dwmac_match);

static struct platform_driver meson8b_dwmac_driver = {
.probe = meson8b_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt,
.remove_new = stmmac_pltfr_remove,
.driver = {
.name = "meson8b-dwmac",
.pm = &stmmac_pltfr_pm_ops,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ static void socfpga_dwmac_remove(struct platform_device *pdev)
struct stmmac_priv *priv = netdev_priv(ndev);
struct phylink_pcs *pcs = priv->hw->lynx_pcs;

stmmac_pltfr_remove_no_dt(pdev);
stmmac_pltfr_remove(pdev);

lynx_pcs_destroy(pcs);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ MODULE_DEVICE_TABLE(of, starfive_dwmac_match);

static struct platform_driver starfive_dwmac_driver = {
.probe = starfive_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt,
.remove_new = stmmac_pltfr_remove,
.driver = {
.name = "starfive-dwmac",
.pm = &stmmac_pltfr_pm_ops,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ static void sun8i_dwmac_remove(struct platform_device *pdev)
clk_put(gmac->ephy_clk);
}

stmmac_pltfr_remove_no_dt(pdev);
stmmac_pltfr_remove(pdev);
sun8i_dwmac_unset_syscon(gmac);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ MODULE_DEVICE_TABLE(of, sun7i_dwmac_match);

static struct platform_driver sun7i_dwmac_driver = {
.probe = sun7i_gmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt,
.remove_new = stmmac_pltfr_remove,
.driver = {
.name = "sun7i-dwmac",
.pm = &stmmac_pltfr_pm_ops,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ static void tegra_mgbe_remove(struct platform_device *pdev)

clk_bulk_disable_unprepare(ARRAY_SIZE(mgbe_clks), mgbe->clks);

stmmac_pltfr_remove_no_dt(pdev);
stmmac_pltfr_remove(pdev);
}

static const struct of_device_id tegra_mgbe_match[] = {
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-visconti.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev)

static void visconti_eth_dwmac_remove(struct platform_device *pdev)
{
stmmac_pltfr_remove_no_dt(pdev);

stmmac_pltfr_remove(pdev);
visconti_eth_clock_remove(pdev);
}

Expand Down
23 changes: 3 additions & 20 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ static void devm_stmmac_pltfr_remove(void *data)
{
struct platform_device *pdev = data;

stmmac_pltfr_remove_no_dt(pdev);
stmmac_pltfr_remove(pdev);
}

/**
Expand All @@ -837,12 +837,12 @@ int devm_stmmac_pltfr_probe(struct platform_device *pdev,
EXPORT_SYMBOL_GPL(devm_stmmac_pltfr_probe);

/**
* stmmac_pltfr_remove_no_dt
* stmmac_pltfr_remove
* @pdev: pointer to the platform device
* Description: This undoes the effects of stmmac_pltfr_probe() by removing the
* driver and calling the platform's exit() callback.
*/
void stmmac_pltfr_remove_no_dt(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);
Expand All @@ -851,23 +851,6 @@ void stmmac_pltfr_remove_no_dt(struct platform_device *pdev)
stmmac_dvr_remove(&pdev->dev);
stmmac_pltfr_exit(pdev, plat);
}
EXPORT_SYMBOL_GPL(stmmac_pltfr_remove_no_dt);

/**
* stmmac_pltfr_remove
* @pdev: platform device pointer
* Description: this function calls the main to free the net resources
* and calls the platforms hook and release the resources (e.g. mem).
*/
void stmmac_pltfr_remove(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct stmmac_priv *priv = netdev_priv(ndev);
struct plat_stmmacenet_data *plat = priv->plat;

stmmac_pltfr_remove_no_dt(pdev);
stmmac_remove_config_dt(pdev, plat);
}
EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);

/**
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ethernet/stmicro/stmmac/stmmac_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ int stmmac_pltfr_probe(struct platform_device *pdev,
int devm_stmmac_pltfr_probe(struct platform_device *pdev,
struct plat_stmmacenet_data *plat,
struct stmmac_resources *res);
void stmmac_pltfr_remove_no_dt(struct platform_device *pdev);
void stmmac_pltfr_remove(struct platform_device *pdev);
extern const struct dev_pm_ops stmmac_pltfr_pm_ops;

Expand Down

0 comments on commit 2c9fc83

Please sign in to comment.