* [PATCH net-next 00/19] net: mdio: Convert to platform remove callback returning void
@ 2023-09-18 19:50 Uwe Kleine-König
2023-09-18 19:51 ` [PATCH net-next 18/19] net: mdio: sun4i: " Uwe Kleine-König
2023-09-21 15:04 ` [PATCH net-next 00/19] net: mdio: " Simon Horman
0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 19:50 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Joel Stanley, Andrew Jeffery, netdev,
linux-arm-kernel, linux-aspeed, linux-kernel, Ray Jui,
Scott Branden, Broadcom internal kernel review list, Doug Berger,
Florian Fainelli, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, linux-amlogic, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, linux-sunxi, Iyappan Subramanian, Keyur Chudgar,
Quan Nguyen
Hello,
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 5c5a7680e67b ("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.
Best regards
Uwe
Uwe Kleine-König (19):
net: mdio: aspeed: Convert to platform remove callback returning void
net: mdio: bcm-iproc: Convert to platform remove callback returning
void
net: mdio: bcm-unimac: Convert to platform remove callback returning
void
net: mdio: gpio: Convert to platform remove callback returning void
net: mdio: hisi-femac: Convert to platform remove callback returning
void
net: mdio: ipq4019: Convert to platform remove callback returning void
net: mdio: ipq8064: Convert to platform remove callback returning void
net: mdio: moxart: Convert to platform remove callback returning void
net: mdio: mscc-miim: Convert to platform remove callback returning
void
net: mdio: mux-bcm-iproc: Convert to platform remove callback
returning void
net: mdio: mux-bcm6368: Convert to platform remove callback returning
void
net: mdio: mux-gpio: Convert to platform remove callback returning
void
net: mdio: mux-meson-g12a: Convert to platform remove callback
returning void
net: mdio: mux-meson-gxl: Convert to platform remove callback
returning void
net: mdio: mux-mmioreg: Convert to platform remove callback returning
void
net: mdio: mux-multiplexer: Convert to platform remove callback
returning void
net: mdio: octeon: Convert to platform remove callback returning void
net: mdio: sun4i: Convert to platform remove callback returning void
net: mdio: xgene: Convert to platform remove callback returning void
drivers/net/mdio/mdio-aspeed.c | 6 ++----
drivers/net/mdio/mdio-bcm-iproc.c | 6 ++----
drivers/net/mdio/mdio-bcm-unimac.c | 6 ++----
drivers/net/mdio/mdio-gpio.c | 6 ++----
drivers/net/mdio/mdio-hisi-femac.c | 6 ++----
drivers/net/mdio/mdio-ipq4019.c | 6 ++----
drivers/net/mdio/mdio-ipq8064.c | 7 ++-----
drivers/net/mdio/mdio-moxart.c | 6 ++----
drivers/net/mdio/mdio-mscc-miim.c | 6 ++----
drivers/net/mdio/mdio-mux-bcm-iproc.c | 6 ++----
drivers/net/mdio/mdio-mux-bcm6368.c | 6 ++----
drivers/net/mdio/mdio-mux-gpio.c | 5 ++---
drivers/net/mdio/mdio-mux-meson-g12a.c | 6 ++----
drivers/net/mdio/mdio-mux-meson-gxl.c | 6 ++----
drivers/net/mdio/mdio-mux-mmioreg.c | 6 ++----
drivers/net/mdio/mdio-mux-multiplexer.c | 6 ++----
drivers/net/mdio/mdio-octeon.c | 5 ++---
drivers/net/mdio/mdio-sun4i.c | 6 ++----
drivers/net/mdio/mdio-xgene.c | 6 ++----
19 files changed, 38 insertions(+), 75 deletions(-)
base-commit: 7fc7222d9680366edeecc219c21ca96310bdbc10
--
2.40.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net-next 18/19] net: mdio: sun4i: Convert to platform remove callback returning void
2023-09-18 19:50 [PATCH net-next 00/19] net: mdio: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-18 19:51 ` Uwe Kleine-König
2023-09-19 17:22 ` Jernej Škrabec
2023-09-21 15:04 ` [PATCH net-next 00/19] net: mdio: " Simon Horman
1 sibling, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 19:51 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, netdev,
linux-arm-kernel, linux-sunxi, linux-kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/mdio/mdio-sun4i.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/mdio/mdio-sun4i.c b/drivers/net/mdio/mdio-sun4i.c
index f798de3276dc..4511bcc73b36 100644
--- a/drivers/net/mdio/mdio-sun4i.c
+++ b/drivers/net/mdio/mdio-sun4i.c
@@ -142,7 +142,7 @@ static int sun4i_mdio_probe(struct platform_device *pdev)
return ret;
}
-static int sun4i_mdio_remove(struct platform_device *pdev)
+static void sun4i_mdio_remove(struct platform_device *pdev)
{
struct mii_bus *bus = platform_get_drvdata(pdev);
struct sun4i_mdio_data *data = bus->priv;
@@ -151,8 +151,6 @@ static int sun4i_mdio_remove(struct platform_device *pdev)
if (data->regulator)
regulator_disable(data->regulator);
mdiobus_free(bus);
-
- return 0;
}
static const struct of_device_id sun4i_mdio_dt_ids[] = {
@@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(of, sun4i_mdio_dt_ids);
static struct platform_driver sun4i_mdio_driver = {
.probe = sun4i_mdio_probe,
- .remove = sun4i_mdio_remove,
+ .remove_new = sun4i_mdio_remove,
.driver = {
.name = "sun4i-mdio",
.of_match_table = sun4i_mdio_dt_ids,
--
2.40.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 18/19] net: mdio: sun4i: Convert to platform remove callback returning void
2023-09-18 19:51 ` [PATCH net-next 18/19] net: mdio: sun4i: " Uwe Kleine-König
@ 2023-09-19 17:22 ` Jernej Škrabec
0 siblings, 0 replies; 4+ messages in thread
From: Jernej Škrabec @ 2023-09-19 17:22 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit, Uwe Kleine-König
Cc: Russell King, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Chen-Yu Tsai, Samuel Holland, netdev,
linux-arm-kernel, linux-sunxi, linux-kernel
Dne ponedeljek, 18. september 2023 ob 21:51:01 CEST je Uwe Kleine-König
napisal(a):
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() is renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/net/mdio/mdio-sun4i.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/mdio/mdio-sun4i.c b/drivers/net/mdio/mdio-sun4i.c
> index f798de3276dc..4511bcc73b36 100644
> --- a/drivers/net/mdio/mdio-sun4i.c
> +++ b/drivers/net/mdio/mdio-sun4i.c
> @@ -142,7 +142,7 @@ static int sun4i_mdio_probe(struct platform_device
> *pdev) return ret;
> }
>
> -static int sun4i_mdio_remove(struct platform_device *pdev)
> +static void sun4i_mdio_remove(struct platform_device *pdev)
> {
> struct mii_bus *bus = platform_get_drvdata(pdev);
> struct sun4i_mdio_data *data = bus->priv;
> @@ -151,8 +151,6 @@ static int sun4i_mdio_remove(struct platform_device
> *pdev) if (data->regulator)
> regulator_disable(data->regulator);
> mdiobus_free(bus);
> -
> - return 0;
> }
>
> static const struct of_device_id sun4i_mdio_dt_ids[] = {
> @@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(of, sun4i_mdio_dt_ids);
>
> static struct platform_driver sun4i_mdio_driver = {
> .probe = sun4i_mdio_probe,
> - .remove = sun4i_mdio_remove,
> + .remove_new = sun4i_mdio_remove,
> .driver = {
> .name = "sun4i-mdio",
> .of_match_table = sun4i_mdio_dt_ids,
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next 00/19] net: mdio: Convert to platform remove callback returning void
2023-09-18 19:50 [PATCH net-next 00/19] net: mdio: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-18 19:51 ` [PATCH net-next 18/19] net: mdio: sun4i: " Uwe Kleine-König
@ 2023-09-21 15:04 ` Simon Horman
1 sibling, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-09-21 15:04 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Joel Stanley,
Andrew Jeffery, netdev, linux-arm-kernel, linux-aspeed,
linux-kernel, Ray Jui, Scott Branden,
Broadcom internal kernel review list, Doug Berger,
Florian Fainelli, Neil Armstrong, Kevin Hilman, Jerome Brunet,
Martin Blumenstingl, linux-amlogic, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, linux-sunxi, Iyappan Subramanian, Keyur Chudgar,
Quan Nguyen
On Mon, Sep 18, 2023 at 09:50:43PM +0200, Uwe Kleine-König wrote:
> Hello,
>
> 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 5c5a7680e67b ("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.
>
> Best regards
> Uwe
For series,
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-21 15:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 19:50 [PATCH net-next 00/19] net: mdio: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-18 19:51 ` [PATCH net-next 18/19] net: mdio: sun4i: " Uwe Kleine-König
2023-09-19 17:22 ` Jernej Škrabec
2023-09-21 15:04 ` [PATCH net-next 00/19] net: mdio: " Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).