* [PATCH 00/31] thermal: Convert to platform remove callback returning void
@ 2023-09-27 19:37 Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 22/31] thermal: rockchip: " Uwe Kleine-König
2023-09-27 19:45 ` [PATCH 00/31] thermal: " Rafael J. Wysocki
0 siblings, 2 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2023-09-27 19:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano
Cc: Guillaume La Roque, Amit Kucheria, Zhang Rui, linux-pm,
linux-amlogic, kernel, Miquel Raynal, Florian Fainelli,
Broadcom internal kernel review list, Ray Jui, Scott Branden,
Niklas Söderlund, Heiko Stuebner, ye xingchen,
linux-rpi-kernel, linux-arm-kernel, Balsam CHIHI, Adam Ward,
Kunihiko Hayashi, AngeloGioacchino Del Regno, Support Opensource,
Shawn Guo, Sascha Hauer, Fabio Estevam, NXP Linux Team,
Srinivas Pandruvada, Yang Yingliang, Matthias Brugger,
Nícolas F. R. A. Prado, Alexandre Mergnat, Chen-Yu Tsai,
Chen Jiahao, linux-mediatek, Thara Gopinath, Andy Gross,
Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
Niklas Söderlund, linux-renesas-soc, linux-rockchip,
Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Alim Akhtar,
linux-samsung-soc, Orson Zhai, Baolin Wang, Chunyan Zhang,
Maxime Coquelin, Alexandre Torgue, Florian Fainelli, Rob Herring,
Minghao Chi, linux-stm32, Thierry Reding, Jonathan Hunter,
Jernej Skrabec, Johan Hovold, linux-tegra, Mikko Perttunen,
Eduardo Valentin, Keerthy, linux-omap, Masami Hiramatsu
Hello,
this series converts all platform drivers below drivers/thermal 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 or a subject prefix is suboptimal, please apply the remainder of
this series anyhow.
Best regards
Uwe
Uwe Kleine-König (31):
thermal: amlogic: Convert to platform remove callback returning void
thermal: armada: Convert to platform remove callback returning void
thermal: bcm2835: Convert to platform remove callback returning void
thermal: ns: Convert to platform remove callback returning void
thermal: da9062: Convert to platform remove callback returning void
thermal: dove: Convert to platform remove callback returning void
thermal: hisi: Convert to platform remove callback returning void
thermal: imx8mm: Convert to platform remove callback returning void
thermal: imx: Convert to platform remove callback returning void
thermal: int3400: Convert to platform remove callback returning void
thermal: int3401: Convert to platform remove callback returning void
thermal: int3402: Convert to platform remove callback returning void
thermal: int3403: Convert to platform remove callback returning void
thermal: int3406: Convert to platform remove callback returning void
thermal: k3_bandgap: Convert to platform remove callback returning void
thermal: k3_j72xx_bandgap: Convert to platform remove callback returning void
thermal: kirkwood: Convert to platform remove callback returning void
thermal: lvts: Convert to platform remove callback returning void
thermal: tsens: Convert to platform remove callback returning void
thermal: rcar_gen3: Convert to platform remove callback returning void
thermal: rcar: Convert to platform remove callback returning void
thermal: rockchip: Convert to platform remove callback returning void
thermal: rzg2l: Convert to platform remove callback returning void
thermal: exynos_tmu: Convert to platform remove callback returning void
thermal: spear: Convert to platform remove callback returning void
thermal: sprd: Convert to platform remove callback returning void
thermal: stm: Convert to platform remove callback returning void
thermal: soctherm: Convert to platform remove callback returning void
thermal: tegra-bpmp: Convert to platform remove callback returning void
thermal: ti-bandgap: Convert to platform remove callback returning void
thermal: uniphier: Convert to platform remove callback returning void
drivers/thermal/amlogic_thermal.c | 12 +++++-------
drivers/thermal/armada_thermal.c | 6 ++----
drivers/thermal/broadcom/bcm2835_thermal.c | 6 ++----
drivers/thermal/broadcom/ns-thermal.c | 6 ++----
drivers/thermal/da9062-thermal.c | 5 ++---
drivers/thermal/dove_thermal.c | 6 ++----
drivers/thermal/hisi_thermal.c | 6 ++----
drivers/thermal/imx8mm_thermal.c | 6 ++----
drivers/thermal/imx_thermal.c | 6 ++----
.../thermal/intel/int340x_thermal/int3400_thermal.c | 5 ++---
.../thermal/intel/int340x_thermal/int3401_thermal.c | 6 ++----
.../thermal/intel/int340x_thermal/int3402_thermal.c | 6 ++----
.../thermal/intel/int340x_thermal/int3403_thermal.c | 6 ++----
.../thermal/intel/int340x_thermal/int3406_thermal.c | 5 ++---
drivers/thermal/k3_bandgap.c | 6 ++----
drivers/thermal/k3_j72xx_bandgap.c | 6 ++----
drivers/thermal/kirkwood_thermal.c | 6 ++----
drivers/thermal/mediatek/lvts_thermal.c | 6 ++----
drivers/thermal/qcom/tsens.c | 6 ++----
drivers/thermal/rcar_gen3_thermal.c | 6 ++----
drivers/thermal/rcar_thermal.c | 6 ++----
drivers/thermal/rockchip_thermal.c | 6 ++----
drivers/thermal/rzg2l_thermal.c | 6 ++----
drivers/thermal/samsung/exynos_tmu.c | 6 ++----
drivers/thermal/spear_thermal.c | 6 ++----
drivers/thermal/sprd_thermal.c | 5 ++---
drivers/thermal/st/stm_thermal.c | 6 ++----
drivers/thermal/tegra/soctherm.c | 6 ++----
drivers/thermal/tegra/tegra-bpmp-thermal.c | 6 ++----
drivers/thermal/ti-soc-thermal/ti-bandgap.c | 6 ++----
drivers/thermal/uniphier_thermal.c | 6 ++----
31 files changed, 65 insertions(+), 123 deletions(-)
base-commit: 18030226a48de1fbfabf4ae16aaa2695a484254f
--
2.40.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 22/31] thermal: rockchip: Convert to platform remove callback returning void
2023-09-27 19:37 [PATCH 00/31] thermal: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-10-01 22:53 ` Heiko Stuebner
2023-09-27 19:45 ` [PATCH 00/31] thermal: " Rafael J. Wysocki
1 sibling, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2023-09-27 19:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano
Cc: Amit Kucheria, Zhang Rui, Heiko Stuebner, linux-pm,
linux-arm-kernel, linux-rockchip, 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() will be 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/thermal/rockchip_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 77231a9d28ff..086ed42dd16c 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -1601,7 +1601,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
return 0;
}
-static int rockchip_thermal_remove(struct platform_device *pdev)
+static void rockchip_thermal_remove(struct platform_device *pdev)
{
struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev);
int i;
@@ -1614,8 +1614,6 @@ static int rockchip_thermal_remove(struct platform_device *pdev)
}
thermal->chip->control(thermal->regs, false);
-
- return 0;
}
static int __maybe_unused rockchip_thermal_suspend(struct device *dev)
@@ -1691,7 +1689,7 @@ static struct platform_driver rockchip_thermal_driver = {
.of_match_table = of_rockchip_thermal_match,
},
.probe = rockchip_thermal_probe,
- .remove = rockchip_thermal_remove,
+ .remove_new = rockchip_thermal_remove,
};
module_platform_driver(rockchip_thermal_driver);
--
2.40.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 00/31] thermal: Convert to platform remove callback returning void
2023-09-27 19:37 [PATCH 00/31] thermal: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 22/31] thermal: rockchip: " Uwe Kleine-König
@ 2023-09-27 19:45 ` Rafael J. Wysocki
2023-09-28 7:05 ` Daniel Lezcano
1 sibling, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2023-09-27 19:45 UTC (permalink / raw)
To: Uwe Kleine-König, Daniel Lezcano
Cc: Rafael J. Wysocki, Guillaume La Roque, Amit Kucheria, Zhang Rui,
linux-pm, linux-amlogic, kernel, Miquel Raynal, Florian Fainelli,
Broadcom internal kernel review list, Ray Jui, Scott Branden,
Niklas Söderlund, Heiko Stuebner, ye xingchen,
linux-rpi-kernel, linux-arm-kernel, Balsam CHIHI, Adam Ward,
Kunihiko Hayashi, AngeloGioacchino Del Regno, Support Opensource,
Shawn Guo, Sascha Hauer, Fabio Estevam, NXP Linux Team,
Srinivas Pandruvada, Yang Yingliang, Matthias Brugger,
Nícolas F. R. A. Prado, Alexandre Mergnat, Chen-Yu Tsai,
Chen Jiahao, linux-mediatek, Thara Gopinath, Andy Gross,
Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
Niklas Söderlund, linux-renesas-soc, linux-rockchip,
Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Alim Akhtar,
linux-samsung-soc, Orson Zhai, Baolin Wang, Chunyan Zhang,
Maxime Coquelin, Alexandre Torgue, Florian Fainelli, Rob Herring,
Minghao Chi, linux-stm32, Thierry Reding, Jonathan Hunter,
Jernej Skrabec, Johan Hovold, linux-tegra, Mikko Perttunen,
Eduardo Valentin, Keerthy, linux-omap, Masami Hiramatsu
Hi,
On Wed, Sep 27, 2023 at 9:38 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> Hello,
>
> this series converts all platform drivers below drivers/thermal 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 or a subject prefix is suboptimal, please apply the remainder of
> this series anyhow.
I think I'll go ahead and apply all of this in one go (for 6.7).
Daniel, any objections?
> Uwe Kleine-König (31):
> thermal: amlogic: Convert to platform remove callback returning void
> thermal: armada: Convert to platform remove callback returning void
> thermal: bcm2835: Convert to platform remove callback returning void
> thermal: ns: Convert to platform remove callback returning void
> thermal: da9062: Convert to platform remove callback returning void
> thermal: dove: Convert to platform remove callback returning void
> thermal: hisi: Convert to platform remove callback returning void
> thermal: imx8mm: Convert to platform remove callback returning void
> thermal: imx: Convert to platform remove callback returning void
> thermal: int3400: Convert to platform remove callback returning void
> thermal: int3401: Convert to platform remove callback returning void
> thermal: int3402: Convert to platform remove callback returning void
> thermal: int3403: Convert to platform remove callback returning void
> thermal: int3406: Convert to platform remove callback returning void
> thermal: k3_bandgap: Convert to platform remove callback returning void
> thermal: k3_j72xx_bandgap: Convert to platform remove callback returning void
> thermal: kirkwood: Convert to platform remove callback returning void
> thermal: lvts: Convert to platform remove callback returning void
> thermal: tsens: Convert to platform remove callback returning void
> thermal: rcar_gen3: Convert to platform remove callback returning void
> thermal: rcar: Convert to platform remove callback returning void
> thermal: rockchip: Convert to platform remove callback returning void
> thermal: rzg2l: Convert to platform remove callback returning void
> thermal: exynos_tmu: Convert to platform remove callback returning void
> thermal: spear: Convert to platform remove callback returning void
> thermal: sprd: Convert to platform remove callback returning void
> thermal: stm: Convert to platform remove callback returning void
> thermal: soctherm: Convert to platform remove callback returning void
> thermal: tegra-bpmp: Convert to platform remove callback returning void
> thermal: ti-bandgap: Convert to platform remove callback returning void
> thermal: uniphier: Convert to platform remove callback returning void
>
> drivers/thermal/amlogic_thermal.c | 12 +++++-------
> drivers/thermal/armada_thermal.c | 6 ++----
> drivers/thermal/broadcom/bcm2835_thermal.c | 6 ++----
> drivers/thermal/broadcom/ns-thermal.c | 6 ++----
> drivers/thermal/da9062-thermal.c | 5 ++---
> drivers/thermal/dove_thermal.c | 6 ++----
> drivers/thermal/hisi_thermal.c | 6 ++----
> drivers/thermal/imx8mm_thermal.c | 6 ++----
> drivers/thermal/imx_thermal.c | 6 ++----
> .../thermal/intel/int340x_thermal/int3400_thermal.c | 5 ++---
> .../thermal/intel/int340x_thermal/int3401_thermal.c | 6 ++----
> .../thermal/intel/int340x_thermal/int3402_thermal.c | 6 ++----
> .../thermal/intel/int340x_thermal/int3403_thermal.c | 6 ++----
> .../thermal/intel/int340x_thermal/int3406_thermal.c | 5 ++---
> drivers/thermal/k3_bandgap.c | 6 ++----
> drivers/thermal/k3_j72xx_bandgap.c | 6 ++----
> drivers/thermal/kirkwood_thermal.c | 6 ++----
> drivers/thermal/mediatek/lvts_thermal.c | 6 ++----
> drivers/thermal/qcom/tsens.c | 6 ++----
> drivers/thermal/rcar_gen3_thermal.c | 6 ++----
> drivers/thermal/rcar_thermal.c | 6 ++----
> drivers/thermal/rockchip_thermal.c | 6 ++----
> drivers/thermal/rzg2l_thermal.c | 6 ++----
> drivers/thermal/samsung/exynos_tmu.c | 6 ++----
> drivers/thermal/spear_thermal.c | 6 ++----
> drivers/thermal/sprd_thermal.c | 5 ++---
> drivers/thermal/st/stm_thermal.c | 6 ++----
> drivers/thermal/tegra/soctherm.c | 6 ++----
> drivers/thermal/tegra/tegra-bpmp-thermal.c | 6 ++----
> drivers/thermal/ti-soc-thermal/ti-bandgap.c | 6 ++----
> drivers/thermal/uniphier_thermal.c | 6 ++----
> 31 files changed, 65 insertions(+), 123 deletions(-)
>
> base-commit: 18030226a48de1fbfabf4ae16aaa2695a484254f
> --
> 2.40.1
>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 00/31] thermal: Convert to platform remove callback returning void
2023-09-27 19:45 ` [PATCH 00/31] thermal: " Rafael J. Wysocki
@ 2023-09-28 7:05 ` Daniel Lezcano
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2023-09-28 7:05 UTC (permalink / raw)
To: Rafael J. Wysocki, Uwe Kleine-König
Cc: Guillaume La Roque, Amit Kucheria, Zhang Rui, linux-pm,
linux-amlogic, kernel, Miquel Raynal, Florian Fainelli,
Broadcom internal kernel review list, Ray Jui, Scott Branden,
Niklas Söderlund, Heiko Stuebner, ye xingchen,
linux-rpi-kernel, linux-arm-kernel, Balsam CHIHI, Adam Ward,
Kunihiko Hayashi, AngeloGioacchino Del Regno, Support Opensource,
Shawn Guo, Sascha Hauer, Fabio Estevam, NXP Linux Team,
Srinivas Pandruvada, Yang Yingliang, Matthias Brugger,
Nícolas F. R. A. Prado, Alexandre Mergnat, Chen-Yu Tsai,
Chen Jiahao, linux-mediatek, Thara Gopinath, Andy Gross,
Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
Niklas Söderlund, linux-renesas-soc, linux-rockchip,
Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Alim Akhtar,
linux-samsung-soc, Orson Zhai, Baolin Wang, Chunyan Zhang,
Maxime Coquelin, Alexandre Torgue, Florian Fainelli, Rob Herring,
Minghao Chi, linux-stm32, Thierry Reding, Jonathan Hunter,
Jernej Skrabec, Johan Hovold, linux-tegra, Mikko Perttunen,
Eduardo Valentin, Keerthy, linux-omap, Masami Hiramatsu
On 27/09/2023 21:45, Rafael J. Wysocki wrote:
> Hi,
>
> On Wed, Sep 27, 2023 at 9:38 PM Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
>>
>> Hello,
>>
>> this series converts all platform drivers below drivers/thermal 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 or a subject prefix is suboptimal, please apply the remainder of
>> this series anyhow.
>
> I think I'll go ahead and apply all of this in one go (for 6.7).
>
> Daniel, any objections?
No objection, for the series:
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 22/31] thermal: rockchip: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 22/31] thermal: rockchip: " Uwe Kleine-König
@ 2023-10-01 22:53 ` Heiko Stuebner
0 siblings, 0 replies; 5+ messages in thread
From: Heiko Stuebner @ 2023-10-01 22:53 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Uwe Kleine-König
Cc: Amit Kucheria, Zhang Rui, linux-pm, linux-arm-kernel,
linux-rockchip, kernel
Am Mittwoch, 27. September 2023, 21:37:27 CEST schrieb Uwe Kleine-König:
> 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() will be 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>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-10-01 22:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-27 19:37 [PATCH 00/31] thermal: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 22/31] thermal: rockchip: " Uwe Kleine-König
2023-10-01 22:53 ` Heiko Stuebner
2023-09-27 19:45 ` [PATCH 00/31] thermal: " Rafael J. Wysocki
2023-09-28 7:05 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox