* [PATCH net-next v2 11/11] net: stmmac: dwmac-tegra: Convert to platform remove callback returning void
2023-05-08 14:26 [PATCH net-next v2 00/11] net: stmmac: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-05-08 14:26 ` Uwe Kleine-König
2023-05-08 20:30 ` [PATCH net-next v2 00/11] net: stmmac: " Michal Kubiak
2023-05-10 3:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2023-05-08 14:26 UTC (permalink / raw)
To: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Thierry Reding, Jonathan Hunter
Cc: netdev, linux-stm32, linux-arm-kernel, linux-tegra, kernel,
Simon Horman, Thierry Reding
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 (mostly) ignored
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.
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
index bdf990cf2f31..f8367c5b490b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
@@ -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,
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net-next v2 00/11] net: stmmac: Convert to platform remove callback returning void
2023-05-08 14:26 [PATCH net-next v2 00/11] net: stmmac: Convert to platform remove callback returning void Uwe Kleine-König
2023-05-08 14:26 ` [PATCH net-next v2 11/11] net: stmmac: dwmac-tegra: " Uwe Kleine-König
@ 2023-05-08 20:30 ` Michal Kubiak
2023-05-10 3:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Michal Kubiak @ 2023-05-08 20:30 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Shawn Guo, Sascha Hauer, Vladimir Zapolskiy, Neil Armstrong,
Kevin Hilman, Vinod Koul, Emil Renner Berthing, Samin Guo,
Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Nobuhiro Iwamatsu,
Matthias Brugger, Thierry Reding, Jonathan Hunter, Fabio Estevam,
NXP Linux Team, Jerome Brunet, Martin Blumenstingl,
Bhupesh Sharma, AngeloGioacchino Del Regno, netdev, linux-stm32,
linux-arm-kernel, kernel, linux-amlogic, linux-oxnas, linux-sunxi,
linux-mediatek, linux-tegra
On Mon, May 08, 2023 at 04:26:26PM +0200, Uwe Kleine-König wrote:
> Hello,
>
> (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
> 4bd3bb7b4526 ("net: stmmac: Add glue layer for StarFive JH7110 SoC"))
>
> Best regards
> Uwe
>
For the series:
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
(Just a very minor nitpick in the commit message of patch 3).
> --
> 2.39.2
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net-next v2 00/11] net: stmmac: Convert to platform remove callback returning void
2023-05-08 14:26 [PATCH net-next v2 00/11] net: stmmac: Convert to platform remove callback returning void Uwe Kleine-König
2023-05-08 14:26 ` [PATCH net-next v2 11/11] net: stmmac: dwmac-tegra: " Uwe Kleine-König
2023-05-08 20:30 ` [PATCH net-next v2 00/11] net: stmmac: " Michal Kubiak
@ 2023-05-10 3:00 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-10 3:00 UTC (permalink / raw)
To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
Cc: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet, kuba,
pabeni, mcoquelin.stm32, shawnguo, s.hauer, vz, neil.armstrong,
khilman, vkoul, kernel, samin.guo, wens, jernej.skrabec, samuel,
nobuhiro1.iwamatsu, matthias.bgg, thierry.reding, jonathanh,
festevam, linux-imx, jbrunet, martin.blumenstingl, bhupesh.sharma,
angelogioacchino.delregno, netdev, linux-stm32, linux-arm-kernel,
kernel, linux-amlogic, linux-oxnas, linux-sunxi, linux-mediatek,
linux-tegra
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 8 May 2023 16:26:26 +0200 you wrote:
> Hello,
>
> (implicit) v1 of this series is available at
> https://lore.kernel.org/netdev/20230402143025.2524443-1-u.kleine-koenig@pengutronix.de
> .
>
> Changes since then:
>
> [...]
Here is the summary with links:
- [net-next,v2,01/11] net: stmmac: Make stmmac_pltfr_remove() return void
https://git.kernel.org/netdev/net-next/c/3246627f11c5
- [net-next,v2,02/11] net: stmmac: dwmac-visconti: Make visconti_eth_clock_remove() return void
https://git.kernel.org/netdev/net-next/c/b9bc44fe068d
- [net-next,v2,03/11] net: stmmac: dwmac-qcom-ethqos: Drop an if with an always false condition
https://git.kernel.org/netdev/net-next/c/c5f3ffe35cc9
- [net-next,v2,04/11] net: stmmac: dwmac-visconti: Convert to platform remove callback returning void
https://git.kernel.org/netdev/net-next/c/f4d05c419761
- [net-next,v2,05/11] net: stmmac: dwmac-dwc-qos-eth: Convert to platform remove callback returning void
https://git.kernel.org/netdev/net-next/c/360cd89064b6
- [net-next,v2,06/11] net: stmmac: dwmac-qcom-ethqos: Convert to platform remove callback returning void
https://git.kernel.org/netdev/net-next/c/5580b559a80a
- [net-next,v2,07/11] net: stmmac: dwmac-rk: Convert to platform remove callback returning void
https://git.kernel.org/netdev/net-next/c/903cc461c901
- [net-next,v2,08/11] net: stmmac: dwmac-sti: Convert to platform remove callback returning void
https://git.kernel.org/netdev/net-next/c/b394982a10d9
- [net-next,v2,09/11] net: stmmac: dwmac-stm32: Convert to platform remove callback returning void
https://git.kernel.org/netdev/net-next/c/fec3f552140e
- [net-next,v2,10/11] net: stmmac: dwmac-sun8i: Convert to platform remove callback returning void
https://git.kernel.org/netdev/net-next/c/cc708d4ed7b3
- [net-next,v2,11/11] net: stmmac: dwmac-tegra: Convert to platform remove callback returning void
https://git.kernel.org/netdev/net-next/c/a86f8601c8f0
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread