Commit 2c9fc838 authored by Jisheng Zhang's avatar Jisheng Zhang Committed by David S. Miller

net: stmmac: rename stmmac_pltfr_remove_no_dt to stmmac_pltfr_remove

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: default avatarJisheng Zhang <jszhang@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d336a117
...@@ -135,7 +135,7 @@ MODULE_DEVICE_TABLE(of, anarion_dwmac_match); ...@@ -135,7 +135,7 @@ MODULE_DEVICE_TABLE(of, anarion_dwmac_match);
static struct platform_driver anarion_dwmac_driver = { static struct platform_driver anarion_dwmac_driver = {
.probe = anarion_dwmac_probe, .probe = anarion_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt, .remove_new = stmmac_pltfr_remove,
.driver = { .driver = {
.name = "anarion-dwmac", .name = "anarion-dwmac",
.pm = &stmmac_pltfr_pm_ops, .pm = &stmmac_pltfr_pm_ops,
......
...@@ -418,7 +418,7 @@ MODULE_DEVICE_TABLE(of, imx_dwmac_match); ...@@ -418,7 +418,7 @@ MODULE_DEVICE_TABLE(of, imx_dwmac_match);
static struct platform_driver imx_dwmac_driver = { static struct platform_driver imx_dwmac_driver = {
.probe = imx_dwmac_probe, .probe = imx_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt, .remove_new = stmmac_pltfr_remove,
.driver = { .driver = {
.name = "imx-dwmac", .name = "imx-dwmac",
.pm = &stmmac_pltfr_pm_ops, .pm = &stmmac_pltfr_pm_ops,
......
...@@ -370,7 +370,7 @@ MODULE_DEVICE_TABLE(of, ingenic_mac_of_matches); ...@@ -370,7 +370,7 @@ MODULE_DEVICE_TABLE(of, ingenic_mac_of_matches);
static struct platform_driver ingenic_mac_driver = { static struct platform_driver ingenic_mac_driver = {
.probe = ingenic_mac_probe, .probe = ingenic_mac_probe,
.remove_new = stmmac_pltfr_remove_no_dt, .remove_new = stmmac_pltfr_remove,
.driver = { .driver = {
.name = "ingenic-mac", .name = "ingenic-mac",
.pm = pm_ptr(&ingenic_mac_pm_ops), .pm = pm_ptr(&ingenic_mac_pm_ops),
......
...@@ -164,7 +164,7 @@ static void intel_eth_plat_remove(struct platform_device *pdev) ...@@ -164,7 +164,7 @@ static void intel_eth_plat_remove(struct platform_device *pdev)
{ {
struct intel_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev); 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); clk_disable_unprepare(dwmac->tx_clk);
} }
......
...@@ -487,7 +487,7 @@ MODULE_DEVICE_TABLE(of, ipq806x_gmac_dwmac_match); ...@@ -487,7 +487,7 @@ MODULE_DEVICE_TABLE(of, ipq806x_gmac_dwmac_match);
static struct platform_driver ipq806x_gmac_dwmac_driver = { static struct platform_driver ipq806x_gmac_dwmac_driver = {
.probe = ipq806x_gmac_probe, .probe = ipq806x_gmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt, .remove_new = stmmac_pltfr_remove,
.driver = { .driver = {
.name = "ipq806x-gmac-dwmac", .name = "ipq806x-gmac-dwmac",
.pm = &stmmac_pltfr_pm_ops, .pm = &stmmac_pltfr_pm_ops,
......
...@@ -72,7 +72,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_dwmac_match); ...@@ -72,7 +72,7 @@ MODULE_DEVICE_TABLE(of, lpc18xx_dwmac_match);
static struct platform_driver lpc18xx_dwmac_driver = { static struct platform_driver lpc18xx_dwmac_driver = {
.probe = lpc18xx_dwmac_probe, .probe = lpc18xx_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt, .remove_new = stmmac_pltfr_remove,
.driver = { .driver = {
.name = "lpc18xx-dwmac", .name = "lpc18xx-dwmac",
.pm = &stmmac_pltfr_pm_ops, .pm = &stmmac_pltfr_pm_ops,
......
...@@ -683,7 +683,7 @@ static void mediatek_dwmac_remove(struct platform_device *pdev) ...@@ -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); 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); mediatek_dwmac_clks_config(priv_plat, false);
} }
......
...@@ -78,7 +78,7 @@ MODULE_DEVICE_TABLE(of, meson6_dwmac_match); ...@@ -78,7 +78,7 @@ MODULE_DEVICE_TABLE(of, meson6_dwmac_match);
static struct platform_driver meson6_dwmac_driver = { static struct platform_driver meson6_dwmac_driver = {
.probe = meson6_dwmac_probe, .probe = meson6_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt, .remove_new = stmmac_pltfr_remove,
.driver = { .driver = {
.name = "meson6-dwmac", .name = "meson6-dwmac",
.pm = &stmmac_pltfr_pm_ops, .pm = &stmmac_pltfr_pm_ops,
......
...@@ -520,7 +520,7 @@ MODULE_DEVICE_TABLE(of, meson8b_dwmac_match); ...@@ -520,7 +520,7 @@ MODULE_DEVICE_TABLE(of, meson8b_dwmac_match);
static struct platform_driver meson8b_dwmac_driver = { static struct platform_driver meson8b_dwmac_driver = {
.probe = meson8b_dwmac_probe, .probe = meson8b_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt, .remove_new = stmmac_pltfr_remove,
.driver = { .driver = {
.name = "meson8b-dwmac", .name = "meson8b-dwmac",
.pm = &stmmac_pltfr_pm_ops, .pm = &stmmac_pltfr_pm_ops,
......
...@@ -500,7 +500,7 @@ static void socfpga_dwmac_remove(struct platform_device *pdev) ...@@ -500,7 +500,7 @@ static void socfpga_dwmac_remove(struct platform_device *pdev)
struct stmmac_priv *priv = netdev_priv(ndev); struct stmmac_priv *priv = netdev_priv(ndev);
struct phylink_pcs *pcs = priv->hw->lynx_pcs; struct phylink_pcs *pcs = priv->hw->lynx_pcs;
stmmac_pltfr_remove_no_dt(pdev); stmmac_pltfr_remove(pdev);
lynx_pcs_destroy(pcs); lynx_pcs_destroy(pcs);
} }
......
...@@ -152,7 +152,7 @@ MODULE_DEVICE_TABLE(of, starfive_dwmac_match); ...@@ -152,7 +152,7 @@ MODULE_DEVICE_TABLE(of, starfive_dwmac_match);
static struct platform_driver starfive_dwmac_driver = { static struct platform_driver starfive_dwmac_driver = {
.probe = starfive_dwmac_probe, .probe = starfive_dwmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt, .remove_new = stmmac_pltfr_remove,
.driver = { .driver = {
.name = "starfive-dwmac", .name = "starfive-dwmac",
.pm = &stmmac_pltfr_pm_ops, .pm = &stmmac_pltfr_pm_ops,
......
...@@ -1312,7 +1312,7 @@ static void sun8i_dwmac_remove(struct platform_device *pdev) ...@@ -1312,7 +1312,7 @@ static void sun8i_dwmac_remove(struct platform_device *pdev)
clk_put(gmac->ephy_clk); clk_put(gmac->ephy_clk);
} }
stmmac_pltfr_remove_no_dt(pdev); stmmac_pltfr_remove(pdev);
sun8i_dwmac_unset_syscon(gmac); sun8i_dwmac_unset_syscon(gmac);
} }
......
...@@ -172,7 +172,7 @@ MODULE_DEVICE_TABLE(of, sun7i_dwmac_match); ...@@ -172,7 +172,7 @@ MODULE_DEVICE_TABLE(of, sun7i_dwmac_match);
static struct platform_driver sun7i_dwmac_driver = { static struct platform_driver sun7i_dwmac_driver = {
.probe = sun7i_gmac_probe, .probe = sun7i_gmac_probe,
.remove_new = stmmac_pltfr_remove_no_dt, .remove_new = stmmac_pltfr_remove,
.driver = { .driver = {
.name = "sun7i-dwmac", .name = "sun7i-dwmac",
.pm = &stmmac_pltfr_pm_ops, .pm = &stmmac_pltfr_pm_ops,
......
...@@ -358,7 +358,7 @@ static void tegra_mgbe_remove(struct platform_device *pdev) ...@@ -358,7 +358,7 @@ static void tegra_mgbe_remove(struct platform_device *pdev)
clk_bulk_disable_unprepare(ARRAY_SIZE(mgbe_clks), mgbe->clks); 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[] = { static const struct of_device_id tegra_mgbe_match[] = {
......
...@@ -256,8 +256,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev) ...@@ -256,8 +256,7 @@ static int visconti_eth_dwmac_probe(struct platform_device *pdev)
static void visconti_eth_dwmac_remove(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); visconti_eth_clock_remove(pdev);
} }
......
...@@ -810,7 +810,7 @@ static void devm_stmmac_pltfr_remove(void *data) ...@@ -810,7 +810,7 @@ static void devm_stmmac_pltfr_remove(void *data)
{ {
struct platform_device *pdev = data; struct platform_device *pdev = data;
stmmac_pltfr_remove_no_dt(pdev); stmmac_pltfr_remove(pdev);
} }
/** /**
...@@ -837,12 +837,12 @@ int devm_stmmac_pltfr_probe(struct platform_device *pdev, ...@@ -837,12 +837,12 @@ int devm_stmmac_pltfr_probe(struct platform_device *pdev,
EXPORT_SYMBOL_GPL(devm_stmmac_pltfr_probe); EXPORT_SYMBOL_GPL(devm_stmmac_pltfr_probe);
/** /**
* stmmac_pltfr_remove_no_dt * stmmac_pltfr_remove
* @pdev: pointer to the platform device * @pdev: pointer to the platform device
* Description: This undoes the effects of stmmac_pltfr_probe() by removing the * Description: This undoes the effects of stmmac_pltfr_probe() by removing the
* driver and calling the platform's exit() callback. * 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 net_device *ndev = platform_get_drvdata(pdev);
struct stmmac_priv *priv = netdev_priv(ndev); struct stmmac_priv *priv = netdev_priv(ndev);
...@@ -851,23 +851,6 @@ void stmmac_pltfr_remove_no_dt(struct platform_device *pdev) ...@@ -851,23 +851,6 @@ void stmmac_pltfr_remove_no_dt(struct platform_device *pdev)
stmmac_dvr_remove(&pdev->dev); stmmac_dvr_remove(&pdev->dev);
stmmac_pltfr_exit(pdev, plat); 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); EXPORT_SYMBOL_GPL(stmmac_pltfr_remove);
/** /**
......
...@@ -32,7 +32,6 @@ int stmmac_pltfr_probe(struct platform_device *pdev, ...@@ -32,7 +32,6 @@ int stmmac_pltfr_probe(struct platform_device *pdev,
int devm_stmmac_pltfr_probe(struct platform_device *pdev, int devm_stmmac_pltfr_probe(struct platform_device *pdev,
struct plat_stmmacenet_data *plat, struct plat_stmmacenet_data *plat,
struct stmmac_resources *res); struct stmmac_resources *res);
void stmmac_pltfr_remove_no_dt(struct platform_device *pdev);
void 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; extern const struct dev_pm_ops stmmac_pltfr_pm_ops;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment