* [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 01/31] thermal: amlogic: " Uwe Kleine-König
2023-09-27 19:45 ` [PATCH 00/31] thermal: " Rafael J. Wysocki
0 siblings, 2 replies; 4+ 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-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 01/31] thermal: amlogic: 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-09-27 19:45 ` [PATCH 00/31] thermal: " Rafael J. Wysocki
1 sibling, 0 replies; 4+ 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
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().
amlogic_thermal_disable() always returned zero. Change it to return no
value and then trivially convert the driver to .remove_new() and fix a
whitespace inconsitency en passant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/thermal/amlogic_thermal.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index 81ebbf6de0de..1426f1eb4ac6 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -167,13 +167,11 @@ static int amlogic_thermal_enable(struct amlogic_thermal *data)
return 0;
}
-static int amlogic_thermal_disable(struct amlogic_thermal *data)
+static void amlogic_thermal_disable(struct amlogic_thermal *data)
{
regmap_update_bits(data->regmap, TSENSOR_CFG_REG1,
TSENSOR_CFG_REG1_ENABLE, 0);
clk_disable_unprepare(data->clk);
-
- return 0;
}
static int amlogic_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
@@ -291,11 +289,11 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
return ret;
}
-static int amlogic_thermal_remove(struct platform_device *pdev)
+static void amlogic_thermal_remove(struct platform_device *pdev)
{
struct amlogic_thermal *data = platform_get_drvdata(pdev);
- return amlogic_thermal_disable(data);
+ amlogic_thermal_disable(data);
}
static int __maybe_unused amlogic_thermal_suspend(struct device *dev)
@@ -321,8 +319,8 @@ static struct platform_driver amlogic_thermal_driver = {
.pm = &amlogic_thermal_pm_ops,
.of_match_table = of_amlogic_thermal_match,
},
- .probe = amlogic_thermal_probe,
- .remove = amlogic_thermal_remove,
+ .probe = amlogic_thermal_probe,
+ .remove_new = amlogic_thermal_remove,
};
module_platform_driver(amlogic_thermal_driver);
--
2.40.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 4+ 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 01/31] thermal: amlogic: " Uwe Kleine-König
@ 2023-09-27 19:45 ` Rafael J. Wysocki
2023-09-28 7:05 ` Daniel Lezcano
1 sibling, 1 reply; 4+ 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-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 4+ 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; 4+ 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-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-28 7:05 UTC | newest]
Thread overview: 4+ 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 01/31] thermal: amlogic: " Uwe Kleine-König
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
all inboxes | Powered by JetHome®