Skip to content

Commit

Permalink
Merge branch 'mdio-platform-remove-void'
Browse files Browse the repository at this point in the history
Uwe Kleine-König says:

====================
net: mdio: Convert to platform remove callback returning void

this series convert all platform drivers below drivers/net/mdio to
use remove_new. The motivation is to get rid of an integer return code
that is (mostly) ignored by the platform driver core and error prone on
the driver side.

See commit 5c5a768 ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.

There are no interdependencies between the patches. As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply, please apply the remainder of this series anyhow.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 20, 2023
2 parents ad1e15d + 032ca4f commit a76c22e
Show file tree
Hide file tree
Showing 19 changed files with 38 additions and 75 deletions.
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-aspeed.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,13 @@ static int aspeed_mdio_probe(struct platform_device *pdev)
return 0;
}

static int aspeed_mdio_remove(struct platform_device *pdev)
static void aspeed_mdio_remove(struct platform_device *pdev)
{
struct mii_bus *bus = (struct mii_bus *)platform_get_drvdata(pdev);
struct aspeed_mdio *ctx = bus->priv;

reset_control_assert(ctx->reset);
mdiobus_unregister(bus);

return 0;
}

static const struct of_device_id aspeed_mdio_of_match[] = {
Expand All @@ -200,7 +198,7 @@ static struct platform_driver aspeed_mdio_driver = {
.of_match_table = aspeed_mdio_of_match,
},
.probe = aspeed_mdio_probe,
.remove = aspeed_mdio_remove,
.remove_new = aspeed_mdio_remove,
};

module_platform_driver(aspeed_mdio_driver);
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-bcm-iproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,12 @@ static int iproc_mdio_probe(struct platform_device *pdev)
return rc;
}

static int iproc_mdio_remove(struct platform_device *pdev)
static void iproc_mdio_remove(struct platform_device *pdev)
{
struct iproc_mdio_priv *priv = platform_get_drvdata(pdev);

mdiobus_unregister(priv->mii_bus);
mdiobus_free(priv->mii_bus);

return 0;
}

#ifdef CONFIG_PM_SLEEP
Expand Down Expand Up @@ -210,7 +208,7 @@ static struct platform_driver iproc_mdio_driver = {
#endif
},
.probe = iproc_mdio_probe,
.remove = iproc_mdio_remove,
.remove_new = iproc_mdio_remove,
};

module_platform_driver(iproc_mdio_driver);
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-bcm-unimac.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,13 @@ static int unimac_mdio_probe(struct platform_device *pdev)
return ret;
}

static int unimac_mdio_remove(struct platform_device *pdev)
static void unimac_mdio_remove(struct platform_device *pdev)
{
struct unimac_mdio_priv *priv = platform_get_drvdata(pdev);

mdiobus_unregister(priv->mii_bus);
mdiobus_free(priv->mii_bus);
clk_disable_unprepare(priv->clk);

return 0;
}

static int __maybe_unused unimac_mdio_suspend(struct device *d)
Expand Down Expand Up @@ -353,7 +351,7 @@ static struct platform_driver unimac_mdio_driver = {
.pm = &unimac_mdio_pm_ops,
},
.probe = unimac_mdio_probe,
.remove = unimac_mdio_remove,
.remove_new = unimac_mdio_remove,
};
module_platform_driver(unimac_mdio_driver);

Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,9 @@ static int mdio_gpio_probe(struct platform_device *pdev)
return ret;
}

static int mdio_gpio_remove(struct platform_device *pdev)
static void mdio_gpio_remove(struct platform_device *pdev)
{
mdio_gpio_bus_destroy(&pdev->dev);

return 0;
}

static const struct of_device_id mdio_gpio_of_match[] = {
Expand All @@ -210,7 +208,7 @@ MODULE_DEVICE_TABLE(of, mdio_gpio_of_match);

static struct platform_driver mdio_gpio_driver = {
.probe = mdio_gpio_probe,
.remove = mdio_gpio_remove,
.remove_new = mdio_gpio_remove,
.driver = {
.name = "mdio-gpio",
.of_match_table = mdio_gpio_of_match,
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-hisi-femac.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,14 @@ static int hisi_femac_mdio_probe(struct platform_device *pdev)
return ret;
}

static int hisi_femac_mdio_remove(struct platform_device *pdev)
static void hisi_femac_mdio_remove(struct platform_device *pdev)
{
struct mii_bus *bus = platform_get_drvdata(pdev);
struct hisi_femac_mdio_data *data = bus->priv;

mdiobus_unregister(bus);
clk_disable_unprepare(data->clk);
mdiobus_free(bus);

return 0;
}

static const struct of_device_id hisi_femac_mdio_dt_ids[] = {
Expand All @@ -138,7 +136,7 @@ MODULE_DEVICE_TABLE(of, hisi_femac_mdio_dt_ids);

static struct platform_driver hisi_femac_mdio_driver = {
.probe = hisi_femac_mdio_probe,
.remove = hisi_femac_mdio_remove,
.remove_new = hisi_femac_mdio_remove,
.driver = {
.name = "hisi-femac-mdio",
.of_match_table = hisi_femac_mdio_dt_ids,
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-ipq4019.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,11 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)
return 0;
}

static int ipq4019_mdio_remove(struct platform_device *pdev)
static void ipq4019_mdio_remove(struct platform_device *pdev)
{
struct mii_bus *bus = platform_get_drvdata(pdev);

mdiobus_unregister(bus);

return 0;
}

static const struct of_device_id ipq4019_mdio_dt_ids[] = {
Expand All @@ -296,7 +294,7 @@ MODULE_DEVICE_TABLE(of, ipq4019_mdio_dt_ids);

static struct platform_driver ipq4019_mdio_driver = {
.probe = ipq4019_mdio_probe,
.remove = ipq4019_mdio_remove,
.remove_new = ipq4019_mdio_remove,
.driver = {
.name = "ipq4019-mdio",
.of_match_table = ipq4019_mdio_dt_ids,
Expand Down
7 changes: 2 additions & 5 deletions drivers/net/mdio/mdio-ipq8064.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,11 @@ ipq8064_mdio_probe(struct platform_device *pdev)
return 0;
}

static int
ipq8064_mdio_remove(struct platform_device *pdev)
static void ipq8064_mdio_remove(struct platform_device *pdev)
{
struct mii_bus *bus = platform_get_drvdata(pdev);

mdiobus_unregister(bus);

return 0;
}

static const struct of_device_id ipq8064_mdio_dt_ids[] = {
Expand All @@ -165,7 +162,7 @@ MODULE_DEVICE_TABLE(of, ipq8064_mdio_dt_ids);

static struct platform_driver ipq8064_mdio_driver = {
.probe = ipq8064_mdio_probe,
.remove = ipq8064_mdio_remove,
.remove_new = ipq8064_mdio_remove,
.driver = {
.name = "ipq8064-mdio",
.of_match_table = ipq8064_mdio_dt_ids,
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-moxart.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,12 @@ static int moxart_mdio_probe(struct platform_device *pdev)
return ret;
}

static int moxart_mdio_remove(struct platform_device *pdev)
static void moxart_mdio_remove(struct platform_device *pdev)
{
struct mii_bus *bus = platform_get_drvdata(pdev);

mdiobus_unregister(bus);
mdiobus_free(bus);

return 0;
}

static const struct of_device_id moxart_mdio_dt_ids[] = {
Expand All @@ -173,7 +171,7 @@ MODULE_DEVICE_TABLE(of, moxart_mdio_dt_ids);

static struct platform_driver moxart_mdio_driver = {
.probe = moxart_mdio_probe,
.remove = moxart_mdio_remove,
.remove_new = moxart_mdio_remove,
.driver = {
.name = "moxart-mdio",
.of_match_table = moxart_mdio_dt_ids,
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-mscc-miim.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,13 @@ static int mscc_miim_probe(struct platform_device *pdev)
return ret;
}

static int mscc_miim_remove(struct platform_device *pdev)
static void mscc_miim_remove(struct platform_device *pdev)
{
struct mii_bus *bus = platform_get_drvdata(pdev);
struct mscc_miim_dev *miim = bus->priv;

clk_disable_unprepare(miim->clk);
mdiobus_unregister(bus);

return 0;
}

static const struct mscc_miim_info mscc_ocelot_miim_info = {
Expand Down Expand Up @@ -371,7 +369,7 @@ MODULE_DEVICE_TABLE(of, mscc_miim_match);

static struct platform_driver mscc_miim_driver = {
.probe = mscc_miim_probe,
.remove = mscc_miim_remove,
.remove_new = mscc_miim_remove,
.driver = {
.name = "mscc-miim",
.of_match_table = mscc_miim_match,
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-mux-bcm-iproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,15 +287,13 @@ static int mdio_mux_iproc_probe(struct platform_device *pdev)
return rc;
}

static int mdio_mux_iproc_remove(struct platform_device *pdev)
static void mdio_mux_iproc_remove(struct platform_device *pdev)
{
struct iproc_mdiomux_desc *md = platform_get_drvdata(pdev);

mdio_mux_uninit(md->mux_handle);
mdiobus_unregister(md->mii_bus);
clk_disable_unprepare(md->core_clk);

return 0;
}

#ifdef CONFIG_PM_SLEEP
Expand Down Expand Up @@ -342,7 +340,7 @@ static struct platform_driver mdiomux_iproc_driver = {
.pm = &mdio_mux_iproc_pm_ops,
},
.probe = mdio_mux_iproc_probe,
.remove = mdio_mux_iproc_remove,
.remove_new = mdio_mux_iproc_remove,
};

module_platform_driver(mdiomux_iproc_driver);
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-mux-bcm6368.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,12 @@ static int bcm6368_mdiomux_probe(struct platform_device *pdev)
return rc;
}

static int bcm6368_mdiomux_remove(struct platform_device *pdev)
static void bcm6368_mdiomux_remove(struct platform_device *pdev)
{
struct bcm6368_mdiomux_desc *md = platform_get_drvdata(pdev);

mdio_mux_uninit(md->mux_handle);
mdiobus_unregister(md->mii_bus);

return 0;
}

static const struct of_device_id bcm6368_mdiomux_ids[] = {
Expand All @@ -175,7 +173,7 @@ static struct platform_driver bcm6368_mdiomux_driver = {
.of_match_table = bcm6368_mdiomux_ids,
},
.probe = bcm6368_mdiomux_probe,
.remove = bcm6368_mdiomux_remove,
.remove_new = bcm6368_mdiomux_remove,
};
module_platform_driver(bcm6368_mdiomux_driver);

Expand Down
5 changes: 2 additions & 3 deletions drivers/net/mdio/mdio-mux-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ static int mdio_mux_gpio_probe(struct platform_device *pdev)
return 0;
}

static int mdio_mux_gpio_remove(struct platform_device *pdev)
static void mdio_mux_gpio_remove(struct platform_device *pdev)
{
struct mdio_mux_gpio_state *s = dev_get_platdata(&pdev->dev);
mdio_mux_uninit(s->mux_handle);
return 0;
}

static const struct of_device_id mdio_mux_gpio_match[] = {
Expand All @@ -87,7 +86,7 @@ static struct platform_driver mdio_mux_gpio_driver = {
.of_match_table = mdio_mux_gpio_match,
},
.probe = mdio_mux_gpio_probe,
.remove = mdio_mux_gpio_remove,
.remove_new = mdio_mux_gpio_remove,
};

module_platform_driver(mdio_mux_gpio_driver);
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-mux-meson-g12a.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,21 +336,19 @@ static int g12a_mdio_mux_probe(struct platform_device *pdev)
return ret;
}

static int g12a_mdio_mux_remove(struct platform_device *pdev)
static void g12a_mdio_mux_remove(struct platform_device *pdev)
{
struct g12a_mdio_mux *priv = platform_get_drvdata(pdev);

mdio_mux_uninit(priv->mux_handle);

if (__clk_is_enabled(priv->pll))
clk_disable_unprepare(priv->pll);

return 0;
}

static struct platform_driver g12a_mdio_mux_driver = {
.probe = g12a_mdio_mux_probe,
.remove = g12a_mdio_mux_remove,
.remove_new = g12a_mdio_mux_remove,
.driver = {
.name = "g12a-mdio_mux",
.of_match_table = g12a_mdio_mux_match,
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-mux-meson-gxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,16 @@ static int gxl_mdio_mux_probe(struct platform_device *pdev)
return ret;
}

static int gxl_mdio_mux_remove(struct platform_device *pdev)
static void gxl_mdio_mux_remove(struct platform_device *pdev)
{
struct gxl_mdio_mux *priv = platform_get_drvdata(pdev);

mdio_mux_uninit(priv->mux_handle);

return 0;
}

static struct platform_driver gxl_mdio_mux_driver = {
.probe = gxl_mdio_mux_probe,
.remove = gxl_mdio_mux_remove,
.remove_new = gxl_mdio_mux_remove,
.driver = {
.name = "gxl-mdio-mux",
.of_match_table = gxl_mdio_mux_match,
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-mux-mmioreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,11 @@ static int mdio_mux_mmioreg_probe(struct platform_device *pdev)
return 0;
}

static int mdio_mux_mmioreg_remove(struct platform_device *pdev)
static void mdio_mux_mmioreg_remove(struct platform_device *pdev)
{
struct mdio_mux_mmioreg_state *s = dev_get_platdata(&pdev->dev);

mdio_mux_uninit(s->mux_handle);

return 0;
}

static const struct of_device_id mdio_mux_mmioreg_match[] = {
Expand All @@ -192,7 +190,7 @@ static struct platform_driver mdio_mux_mmioreg_driver = {
.of_match_table = mdio_mux_mmioreg_match,
},
.probe = mdio_mux_mmioreg_probe,
.remove = mdio_mux_mmioreg_remove,
.remove_new = mdio_mux_mmioreg_remove,
};

module_platform_driver(mdio_mux_mmioreg_driver);
Expand Down
6 changes: 2 additions & 4 deletions drivers/net/mdio/mdio-mux-multiplexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,14 @@ static int mdio_mux_multiplexer_probe(struct platform_device *pdev)
return ret;
}

static int mdio_mux_multiplexer_remove(struct platform_device *pdev)
static void mdio_mux_multiplexer_remove(struct platform_device *pdev)
{
struct mdio_mux_multiplexer_state *s = platform_get_drvdata(pdev);

mdio_mux_uninit(s->mux_handle);

if (s->do_deselect)
mux_control_deselect(s->muxc);

return 0;
}

static const struct of_device_id mdio_mux_multiplexer_match[] = {
Expand All @@ -109,7 +107,7 @@ static struct platform_driver mdio_mux_multiplexer_driver = {
.of_match_table = mdio_mux_multiplexer_match,
},
.probe = mdio_mux_multiplexer_probe,
.remove = mdio_mux_multiplexer_remove,
.remove_new = mdio_mux_multiplexer_remove,
};

module_platform_driver(mdio_mux_multiplexer_driver);
Expand Down
Loading

0 comments on commit a76c22e

Please sign in to comment.