* [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
` (31 more replies)
0 siblings, 32 replies; 44+ 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
^ permalink raw reply [flat|nested] 44+ 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:37 ` [PATCH 02/31] thermal: armada: " Uwe Kleine-König
` (30 subsequent siblings)
31 siblings, 0 replies; 44+ 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
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 02/31] thermal: armada: 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:37 ` Uwe Kleine-König
2023-10-01 16:09 ` Miquel Raynal
2023-09-27 19:37 ` [PATCH 03/31] thermal: bcm2835: " Uwe Kleine-König
` (29 subsequent siblings)
31 siblings, 1 reply; 44+ messages in thread
From: Uwe Kleine-König @ 2023-09-27 19:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano
Cc: Miquel Raynal, Amit Kucheria, Zhang Rui, linux-pm, 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/armada_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/armada_thermal.c b/drivers/thermal/armada_thermal.c
index f00765bfc22e..f783547ef964 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -965,19 +965,17 @@ static int armada_thermal_probe(struct platform_device *pdev)
return 0;
}
-static int armada_thermal_exit(struct platform_device *pdev)
+static void armada_thermal_exit(struct platform_device *pdev)
{
struct armada_drvdata *drvdata = platform_get_drvdata(pdev);
if (drvdata->type == LEGACY)
thermal_zone_device_unregister(drvdata->data.tz);
-
- return 0;
}
static struct platform_driver armada_thermal_driver = {
.probe = armada_thermal_probe,
- .remove = armada_thermal_exit,
+ .remove_new = armada_thermal_exit,
.driver = {
.name = "armada_thermal",
.of_match_table = armada_thermal_id_table,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 03/31] thermal: bcm2835: 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:37 ` [PATCH 02/31] thermal: armada: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 04/31] thermal: ns: " Uwe Kleine-König
` (28 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Florian Fainelli,
Broadcom internal kernel review list, Ray Jui, Scott Branden,
Niklas Söderlund, Heiko Stuebner, ye xingchen, linux-pm,
linux-rpi-kernel, linux-arm-kernel, 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/broadcom/bcm2835_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/broadcom/bcm2835_thermal.c b/drivers/thermal/broadcom/bcm2835_thermal.c
index 3acc9288b310..5c1cebe07580 100644
--- a/drivers/thermal/broadcom/bcm2835_thermal.c
+++ b/drivers/thermal/broadcom/bcm2835_thermal.c
@@ -282,19 +282,17 @@ static int bcm2835_thermal_probe(struct platform_device *pdev)
return err;
}
-static int bcm2835_thermal_remove(struct platform_device *pdev)
+static void bcm2835_thermal_remove(struct platform_device *pdev)
{
struct bcm2835_thermal_data *data = platform_get_drvdata(pdev);
debugfs_remove_recursive(data->debugfsdir);
clk_disable_unprepare(data->clk);
-
- return 0;
}
static struct platform_driver bcm2835_thermal_driver = {
.probe = bcm2835_thermal_probe,
- .remove = bcm2835_thermal_remove,
+ .remove_new = bcm2835_thermal_remove,
.driver = {
.name = "bcm2835_thermal",
.of_match_table = bcm2835_thermal_of_match_table,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 04/31] thermal: ns: 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
` (2 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 03/31] thermal: bcm2835: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 05/31] thermal: da9062: " Uwe Kleine-König
` (27 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Balsam CHIHI, Adam Ward,
Kunihiko Hayashi, AngeloGioacchino Del Regno, linux-pm, 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/broadcom/ns-thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/broadcom/ns-thermal.c b/drivers/thermal/broadcom/ns-thermal.c
index d255aa879fc0..5eaf79c490f0 100644
--- a/drivers/thermal/broadcom/ns-thermal.c
+++ b/drivers/thermal/broadcom/ns-thermal.c
@@ -65,13 +65,11 @@ static int ns_thermal_probe(struct platform_device *pdev)
return 0;
}
-static int ns_thermal_remove(struct platform_device *pdev)
+static void ns_thermal_remove(struct platform_device *pdev)
{
void __iomem *pvtmon = platform_get_drvdata(pdev);
iounmap(pvtmon);
-
- return 0;
}
static const struct of_device_id ns_thermal_of_match[] = {
@@ -82,7 +80,7 @@ MODULE_DEVICE_TABLE(of, ns_thermal_of_match);
static struct platform_driver ns_thermal_driver = {
.probe = ns_thermal_probe,
- .remove = ns_thermal_remove,
+ .remove_new = ns_thermal_remove,
.driver = {
.name = "ns-thermal",
.of_match_table = ns_thermal_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 05/31] thermal: da9062: 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
` (3 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 04/31] thermal: ns: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 06/31] thermal: dove: " Uwe Kleine-König
` (26 subsequent siblings)
31 siblings, 0 replies; 44+ messages in thread
From: Uwe Kleine-König @ 2023-09-27 19:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano
Cc: Support Opensource, Amit Kucheria, Zhang Rui, linux-pm, 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/da9062-thermal.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/da9062-thermal.c b/drivers/thermal/da9062-thermal.c
index 2d31b1f73423..160d64913057 100644
--- a/drivers/thermal/da9062-thermal.c
+++ b/drivers/thermal/da9062-thermal.c
@@ -239,19 +239,18 @@ static int da9062_thermal_probe(struct platform_device *pdev)
return ret;
}
-static int da9062_thermal_remove(struct platform_device *pdev)
+static void da9062_thermal_remove(struct platform_device *pdev)
{
struct da9062_thermal *thermal = platform_get_drvdata(pdev);
free_irq(thermal->irq, thermal);
cancel_delayed_work_sync(&thermal->work);
thermal_zone_device_unregister(thermal->zone);
- return 0;
}
static struct platform_driver da9062_thermal_driver = {
.probe = da9062_thermal_probe,
- .remove = da9062_thermal_remove,
+ .remove_new = da9062_thermal_remove,
.driver = {
.name = "da9062-thermal",
.of_match_table = da9062_compatible_reg_id_table,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 06/31] thermal: dove: 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
` (4 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 05/31] thermal: da9062: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 07/31] thermal: hisi: " Uwe Kleine-König
` (25 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/dove_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index 7a18cb960bee..ac30de3c0a5f 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -158,21 +158,19 @@ static int dove_thermal_probe(struct platform_device *pdev)
return 0;
}
-static int dove_thermal_exit(struct platform_device *pdev)
+static void dove_thermal_exit(struct platform_device *pdev)
{
struct thermal_zone_device *dove_thermal =
platform_get_drvdata(pdev);
thermal_zone_device_unregister(dove_thermal);
-
- return 0;
}
MODULE_DEVICE_TABLE(of, dove_thermal_id_table);
static struct platform_driver dove_thermal_driver = {
.probe = dove_thermal_probe,
- .remove = dove_thermal_exit,
+ .remove_new = dove_thermal_exit,
.driver = {
.name = "dove_thermal",
.of_match_table = dove_thermal_id_table,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 07/31] thermal: hisi: 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
` (5 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 06/31] thermal: dove: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 08/31] thermal: imx8mm: " Uwe Kleine-König
` (24 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/hisi_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index fb54ed4bf6f0..dd751ae63608 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -597,7 +597,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
return 0;
}
-static int hisi_thermal_remove(struct platform_device *pdev)
+static void hisi_thermal_remove(struct platform_device *pdev)
{
struct hisi_thermal_data *data = platform_get_drvdata(pdev);
int i;
@@ -608,8 +608,6 @@ static int hisi_thermal_remove(struct platform_device *pdev)
hisi_thermal_toggle_sensor(sensor, false);
data->ops->disable_sensor(sensor);
}
-
- return 0;
}
static int hisi_thermal_suspend(struct device *dev)
@@ -644,7 +642,7 @@ static struct platform_driver hisi_thermal_driver = {
.of_match_table = of_hisi_thermal_match,
},
.probe = hisi_thermal_probe,
- .remove = hisi_thermal_remove,
+ .remove_new = hisi_thermal_remove,
};
module_platform_driver(hisi_thermal_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 08/31] thermal: imx8mm: 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
` (6 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 07/31] thermal: hisi: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 09/31] thermal: imx: " Uwe Kleine-König
` (23 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Shawn Guo, Sascha Hauer, Fabio Estevam,
NXP Linux Team, linux-pm, linux-arm-kernel, 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/imx8mm_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index 14111ccf6e4c..c58fc73c0744 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -363,7 +363,7 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
return ret;
}
-static int imx8mm_tmu_remove(struct platform_device *pdev)
+static void imx8mm_tmu_remove(struct platform_device *pdev)
{
struct imx8mm_tmu *tmu = platform_get_drvdata(pdev);
@@ -372,8 +372,6 @@ static int imx8mm_tmu_remove(struct platform_device *pdev)
clk_disable_unprepare(tmu->clk);
platform_set_drvdata(pdev, NULL);
-
- return 0;
}
static struct thermal_soc_data imx8mm_tmu_data = {
@@ -401,7 +399,7 @@ static struct platform_driver imx8mm_tmu = {
.of_match_table = imx8mm_tmu_table,
},
.probe = imx8mm_tmu_probe,
- .remove = imx8mm_tmu_remove,
+ .remove_new = imx8mm_tmu_remove,
};
module_platform_driver(imx8mm_tmu);
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 09/31] thermal: imx: 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
` (7 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 08/31] thermal: imx8mm: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 10/31] thermal: int3400: " Uwe Kleine-König
` (22 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Shawn Guo, Sascha Hauer, Fabio Estevam,
NXP Linux Team, linux-pm, linux-arm-kernel, 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/imx_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 826358cbe810..7019c4fdd549 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -771,7 +771,7 @@ static int imx_thermal_probe(struct platform_device *pdev)
return ret;
}
-static int imx_thermal_remove(struct platform_device *pdev)
+static void imx_thermal_remove(struct platform_device *pdev)
{
struct imx_thermal_data *data = platform_get_drvdata(pdev);
@@ -780,8 +780,6 @@ static int imx_thermal_remove(struct platform_device *pdev)
thermal_zone_device_unregister(data->tz);
imx_thermal_unregister_legacy_cooling(data);
-
- return 0;
}
static int __maybe_unused imx_thermal_suspend(struct device *dev)
@@ -880,7 +878,7 @@ static struct platform_driver imx_thermal = {
.of_match_table = of_imx_thermal_match,
},
.probe = imx_thermal_probe,
- .remove = imx_thermal_remove,
+ .remove_new = imx_thermal_remove,
};
module_platform_driver(imx_thermal);
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 10/31] thermal: int3400: 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
` (8 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 09/31] thermal: imx: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 11/31] thermal: int3401: " Uwe Kleine-König
` (21 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Srinivas Pandruvada, Adam Ward,
AngeloGioacchino Del Regno, ye xingchen, linux-pm, 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/intel/int340x_thermal/int3400_thermal.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index ffc2871a021c..427d370648d5 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -674,7 +674,7 @@ static int int3400_thermal_probe(struct platform_device *pdev)
return result;
}
-static int int3400_thermal_remove(struct platform_device *pdev)
+static void int3400_thermal_remove(struct platform_device *pdev)
{
struct int3400_thermal_priv *priv = platform_get_drvdata(pdev);
@@ -698,7 +698,6 @@ static int int3400_thermal_remove(struct platform_device *pdev)
kfree(priv->trts);
kfree(priv->arts);
kfree(priv);
- return 0;
}
static const struct acpi_device_id int3400_thermal_match[] = {
@@ -714,7 +713,7 @@ MODULE_DEVICE_TABLE(acpi, int3400_thermal_match);
static struct platform_driver int3400_thermal_driver = {
.probe = int3400_thermal_probe,
- .remove = int3400_thermal_remove,
+ .remove_new = int3400_thermal_remove,
.driver = {
.name = "int3400 thermal",
.acpi_match_table = ACPI_PTR(int3400_thermal_match),
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 11/31] thermal: int3401: 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
` (9 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 10/31] thermal: int3400: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 12/31] thermal: int3402: " Uwe Kleine-König
` (20 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Yang Yingliang, linux-pm, 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/intel/int340x_thermal/int3401_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/int3401_thermal.c b/drivers/thermal/intel/int340x_thermal/int3401_thermal.c
index c93a28eec4db..193645a73861 100644
--- a/drivers/thermal/intel/int340x_thermal/int3401_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3401_thermal.c
@@ -36,11 +36,9 @@ static int int3401_add(struct platform_device *pdev)
return ret;
}
-static int int3401_remove(struct platform_device *pdev)
+static void int3401_remove(struct platform_device *pdev)
{
proc_thermal_remove(platform_get_drvdata(pdev));
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -62,7 +60,7 @@ static SIMPLE_DEV_PM_OPS(int3401_proc_thermal_pm, int3401_thermal_suspend,
static struct platform_driver int3401_driver = {
.probe = int3401_add,
- .remove = int3401_remove,
+ .remove_new = int3401_remove,
.driver = {
.name = "int3401 thermal",
.acpi_match_table = int3401_device_ids,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 12/31] thermal: int3402: 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
` (10 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 11/31] thermal: int3401: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 13/31] thermal: int3403: " Uwe Kleine-König
` (19 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/intel/int340x_thermal/int3402_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/int3402_thermal.c b/drivers/thermal/intel/int340x_thermal/int3402_thermal.c
index 43fa351e2b9e..ab8bfb5a3946 100644
--- a/drivers/thermal/intel/int340x_thermal/int3402_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3402_thermal.c
@@ -71,15 +71,13 @@ static int int3402_thermal_probe(struct platform_device *pdev)
return 0;
}
-static int int3402_thermal_remove(struct platform_device *pdev)
+static void int3402_thermal_remove(struct platform_device *pdev)
{
struct int3402_thermal_data *d = platform_get_drvdata(pdev);
acpi_remove_notify_handler(d->handle,
ACPI_DEVICE_NOTIFY, int3402_notify);
int340x_thermal_zone_remove(d->int340x_zone);
-
- return 0;
}
static const struct acpi_device_id int3402_thermal_match[] = {
@@ -91,7 +89,7 @@ MODULE_DEVICE_TABLE(acpi, int3402_thermal_match);
static struct platform_driver int3402_thermal_driver = {
.probe = int3402_thermal_probe,
- .remove = int3402_thermal_remove,
+ .remove_new = int3402_thermal_remove,
.driver = {
.name = "int3402 thermal",
.acpi_match_table = int3402_thermal_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 13/31] thermal: int3403: 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
` (11 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 12/31] thermal: int3402: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 14/31] thermal: int3406: " Uwe Kleine-König
` (18 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/intel/int340x_thermal/int3403_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c
index e418d270bc76..9b33fd3a66da 100644
--- a/drivers/thermal/intel/int340x_thermal/int3403_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3403_thermal.c
@@ -262,7 +262,7 @@ static int int3403_add(struct platform_device *pdev)
return result;
}
-static int int3403_remove(struct platform_device *pdev)
+static void int3403_remove(struct platform_device *pdev)
{
struct int3403_priv *priv = platform_get_drvdata(pdev);
@@ -277,8 +277,6 @@ static int int3403_remove(struct platform_device *pdev)
default:
break;
}
-
- return 0;
}
static const struct acpi_device_id int3403_device_ids[] = {
@@ -293,7 +291,7 @@ MODULE_DEVICE_TABLE(acpi, int3403_device_ids);
static struct platform_driver int3403_driver = {
.probe = int3403_add,
- .remove = int3403_remove,
+ .remove_new = int3403_remove,
.driver = {
.name = "int3403 thermal",
.acpi_match_table = int3403_device_ids,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 14/31] thermal: int3406: 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
` (12 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 13/31] thermal: int3403: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 15/31] thermal: k3_bandgap: " Uwe Kleine-König
` (17 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/intel/int340x_thermal/int3406_thermal.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/intel/int340x_thermal/int3406_thermal.c b/drivers/thermal/intel/int340x_thermal/int3406_thermal.c
index f5e42fc2acc0..1c266493c1aa 100644
--- a/drivers/thermal/intel/int340x_thermal/int3406_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3406_thermal.c
@@ -178,13 +178,12 @@ static int int3406_thermal_probe(struct platform_device *pdev)
return -ENODEV;
}
-static int int3406_thermal_remove(struct platform_device *pdev)
+static void int3406_thermal_remove(struct platform_device *pdev)
{
struct int3406_thermal_data *d = platform_get_drvdata(pdev);
thermal_cooling_device_unregister(d->cooling_dev);
kfree(d->br);
- return 0;
}
static const struct acpi_device_id int3406_thermal_match[] = {
@@ -196,7 +195,7 @@ MODULE_DEVICE_TABLE(acpi, int3406_thermal_match);
static struct platform_driver int3406_thermal_driver = {
.probe = int3406_thermal_probe,
- .remove = int3406_thermal_remove,
+ .remove_new = int3406_thermal_remove,
.driver = {
.name = "int3406 thermal",
.acpi_match_table = int3406_thermal_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 15/31] thermal: k3_bandgap: 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
` (13 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 14/31] thermal: int3406: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 16/31] thermal: k3_j72xx_bandgap: " Uwe Kleine-König
` (16 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/k3_bandgap.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/k3_bandgap.c b/drivers/thermal/k3_bandgap.c
index 4a918c1e92f9..e88192d2afea 100644
--- a/drivers/thermal/k3_bandgap.c
+++ b/drivers/thermal/k3_bandgap.c
@@ -235,12 +235,10 @@ static int k3_bandgap_probe(struct platform_device *pdev)
return ret;
}
-static int k3_bandgap_remove(struct platform_device *pdev)
+static void k3_bandgap_remove(struct platform_device *pdev)
{
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
-
- return 0;
}
static const struct of_device_id of_k3_bandgap_match[] = {
@@ -253,7 +251,7 @@ MODULE_DEVICE_TABLE(of, of_k3_bandgap_match);
static struct platform_driver k3_bandgap_sensor_driver = {
.probe = k3_bandgap_probe,
- .remove = k3_bandgap_remove,
+ .remove_new = k3_bandgap_remove,
.driver = {
.name = "k3-soc-thermal",
.of_match_table = of_k3_bandgap_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 16/31] thermal: k3_j72xx_bandgap: 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
` (14 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 15/31] thermal: k3_bandgap: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 17/31] thermal: kirkwood: " Uwe Kleine-König
` (15 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/k3_j72xx_bandgap.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/k3_j72xx_bandgap.c b/drivers/thermal/k3_j72xx_bandgap.c
index 2fc799b07b90..c74094a86982 100644
--- a/drivers/thermal/k3_j72xx_bandgap.c
+++ b/drivers/thermal/k3_j72xx_bandgap.c
@@ -521,12 +521,10 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
return ret;
}
-static int k3_j72xx_bandgap_remove(struct platform_device *pdev)
+static void k3_j72xx_bandgap_remove(struct platform_device *pdev)
{
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
-
- return 0;
}
static const struct k3_j72xx_bandgap_data k3_j72xx_bandgap_j721e_data = {
@@ -552,7 +550,7 @@ MODULE_DEVICE_TABLE(of, of_k3_j72xx_bandgap_match);
static struct platform_driver k3_j72xx_bandgap_sensor_driver = {
.probe = k3_j72xx_bandgap_probe,
- .remove = k3_j72xx_bandgap_remove,
+ .remove_new = k3_j72xx_bandgap_remove,
.driver = {
.name = "k3-j72xx-soc-thermal",
.of_match_table = of_k3_j72xx_bandgap_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 17/31] thermal: kirkwood: 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
` (15 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 16/31] thermal: k3_j72xx_bandgap: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 18/31] thermal: lvts: " Uwe Kleine-König
` (14 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/kirkwood_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/kirkwood_thermal.c b/drivers/thermal/kirkwood_thermal.c
index acb10d24256d..a18158ebe65f 100644
--- a/drivers/thermal/kirkwood_thermal.c
+++ b/drivers/thermal/kirkwood_thermal.c
@@ -90,21 +90,19 @@ static int kirkwood_thermal_probe(struct platform_device *pdev)
return 0;
}
-static int kirkwood_thermal_exit(struct platform_device *pdev)
+static void kirkwood_thermal_exit(struct platform_device *pdev)
{
struct thermal_zone_device *kirkwood_thermal =
platform_get_drvdata(pdev);
thermal_zone_device_unregister(kirkwood_thermal);
-
- return 0;
}
MODULE_DEVICE_TABLE(of, kirkwood_thermal_id_table);
static struct platform_driver kirkwood_thermal_driver = {
.probe = kirkwood_thermal_probe,
- .remove = kirkwood_thermal_exit,
+ .remove_new = kirkwood_thermal_exit,
.driver = {
.name = "kirkwood_thermal",
.of_match_table = kirkwood_thermal_id_table,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 18/31] thermal: lvts: 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
` (16 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 17/31] thermal: kirkwood: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-28 11:13 ` AngeloGioacchino Del Regno
2023-09-27 19:37 ` [PATCH 19/31] thermal: tsens: " Uwe Kleine-König
` (13 subsequent siblings)
31 siblings, 1 reply; 44+ 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, Matthias Brugger,
AngeloGioacchino Del Regno, Nícolas F. R. A. Prado,
Alexandre Mergnat, Balsam CHIHI, Chen-Yu Tsai, Chen Jiahao,
linux-pm, kernel, linux-arm-kernel, linux-mediatek
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/mediatek/lvts_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
index effd9b00a424..877a0e5ac3fd 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -1241,7 +1241,7 @@ static int lvts_probe(struct platform_device *pdev)
return 0;
}
-static int lvts_remove(struct platform_device *pdev)
+static void lvts_remove(struct platform_device *pdev)
{
struct lvts_domain *lvts_td;
int i;
@@ -1252,8 +1252,6 @@ static int lvts_remove(struct platform_device *pdev)
lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false);
lvts_debugfs_exit(lvts_td);
-
- return 0;
}
static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = {
@@ -1354,7 +1352,7 @@ MODULE_DEVICE_TABLE(of, lvts_of_match);
static struct platform_driver lvts_driver = {
.probe = lvts_probe,
- .remove = lvts_remove,
+ .remove_new = lvts_remove,
.driver = {
.name = "mtk-lvts-thermal",
.of_match_table = lvts_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 19/31] thermal: tsens: 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
` (17 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 18/31] thermal: lvts: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 20/31] thermal: rcar_gen3: " Uwe Kleine-König
` (12 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Thara Gopinath, Andy Gross, Bjorn Andersson,
Konrad Dybcio, Zhang Rui, linux-pm, linux-arm-msm, 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/qcom/tsens.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index 98c356acfe98..6d7c16ccb44d 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -1319,7 +1319,7 @@ static int tsens_probe(struct platform_device *pdev)
return ret;
}
-static int tsens_remove(struct platform_device *pdev)
+static void tsens_remove(struct platform_device *pdev)
{
struct tsens_priv *priv = platform_get_drvdata(pdev);
@@ -1327,13 +1327,11 @@ static int tsens_remove(struct platform_device *pdev)
tsens_disable_irq(priv);
if (priv->ops->disable)
priv->ops->disable(priv);
-
- return 0;
}
static struct platform_driver tsens_driver = {
.probe = tsens_probe,
- .remove = tsens_remove,
+ .remove_new = tsens_remove,
.driver = {
.name = "qcom-tsens",
.pm = &tsens_pm_ops,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 20/31] thermal: rcar_gen3: 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
` (18 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 19/31] thermal: tsens: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:40 ` Wolfram Sang
` (2 more replies)
2023-09-27 19:37 ` [PATCH 21/31] thermal: rcar: " Uwe Kleine-König
` (11 subsequent siblings)
31 siblings, 3 replies; 44+ messages in thread
From: Uwe Kleine-König @ 2023-09-27 19:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano
Cc: Niklas Söderlund, Amit Kucheria, Zhang Rui,
linux-renesas-soc, linux-pm, 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/rcar_gen3_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
index bd2fb8c2e968..cafcb6d6e235 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -432,14 +432,12 @@ static const struct of_device_id rcar_gen3_thermal_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids);
-static int rcar_gen3_thermal_remove(struct platform_device *pdev)
+static void rcar_gen3_thermal_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
pm_runtime_put(dev);
pm_runtime_disable(dev);
-
- return 0;
}
static void rcar_gen3_hwmon_action(void *data)
@@ -594,7 +592,7 @@ static struct platform_driver rcar_gen3_thermal_driver = {
.of_match_table = rcar_gen3_thermal_dt_ids,
},
.probe = rcar_gen3_thermal_probe,
- .remove = rcar_gen3_thermal_remove,
+ .remove_new = rcar_gen3_thermal_remove,
};
module_platform_driver(rcar_gen3_thermal_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 21/31] thermal: rcar: 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
` (19 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 20/31] thermal: rcar_gen3: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:40 ` Wolfram Sang
` (2 more replies)
2023-09-27 19:37 ` [PATCH 22/31] thermal: rockchip: " Uwe Kleine-König
` (10 subsequent siblings)
31 siblings, 3 replies; 44+ messages in thread
From: Uwe Kleine-König @ 2023-09-27 19:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano
Cc: Niklas Söderlund, Amit Kucheria, Zhang Rui,
linux-renesas-soc, linux-pm, 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/rcar_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 293f8dd9fe0a..feb848d595fa 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -371,7 +371,7 @@ static irqreturn_t rcar_thermal_irq(int irq, void *data)
/*
* platform functions
*/
-static int rcar_thermal_remove(struct platform_device *pdev)
+static void rcar_thermal_remove(struct platform_device *pdev)
{
struct rcar_thermal_common *common = platform_get_drvdata(pdev);
struct device *dev = &pdev->dev;
@@ -388,8 +388,6 @@ static int rcar_thermal_remove(struct platform_device *pdev)
pm_runtime_put(dev);
pm_runtime_disable(dev);
-
- return 0;
}
static int rcar_thermal_probe(struct platform_device *pdev)
@@ -581,7 +579,7 @@ static struct platform_driver rcar_thermal_driver = {
.of_match_table = rcar_thermal_dt_ids,
},
.probe = rcar_thermal_probe,
- .remove = rcar_thermal_remove,
+ .remove_new = rcar_thermal_remove,
};
module_platform_driver(rcar_thermal_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ 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
` (20 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 21/31] thermal: rcar: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-10-01 22:53 ` Heiko Stuebner
2023-09-27 19:37 ` [PATCH 23/31] thermal: rzg2l: " Uwe Kleine-König
` (9 subsequent siblings)
31 siblings, 1 reply; 44+ 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
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 23/31] thermal: rzg2l: 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
` (21 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 22/31] thermal: rockchip: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 24/31] thermal: exynos_tmu: " Uwe Kleine-König
` (8 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/rzg2l_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/rzg2l_thermal.c b/drivers/thermal/rzg2l_thermal.c
index 6b2bf3426f52..04efd824ac4c 100644
--- a/drivers/thermal/rzg2l_thermal.c
+++ b/drivers/thermal/rzg2l_thermal.c
@@ -150,14 +150,12 @@ static void rzg2l_thermal_reset_assert_pm_disable_put(struct platform_device *pd
reset_control_assert(priv->rstc);
}
-static int rzg2l_thermal_remove(struct platform_device *pdev)
+static void rzg2l_thermal_remove(struct platform_device *pdev)
{
struct rzg2l_thermal_priv *priv = dev_get_drvdata(&pdev->dev);
thermal_remove_hwmon_sysfs(priv->zone);
rzg2l_thermal_reset_assert_pm_disable_put(pdev);
-
- return 0;
}
static int rzg2l_thermal_probe(struct platform_device *pdev)
@@ -242,7 +240,7 @@ static struct platform_driver rzg2l_thermal_driver = {
.of_match_table = rzg2l_thermal_dt_ids,
},
.probe = rzg2l_thermal_probe,
- .remove = rzg2l_thermal_remove,
+ .remove_new = rzg2l_thermal_remove,
};
module_platform_driver(rzg2l_thermal_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 24/31] thermal: exynos_tmu: 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
` (22 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 23/31] thermal: rzg2l: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 25/31] thermal: spear: " Uwe Kleine-König
` (7 subsequent siblings)
31 siblings, 0 replies; 44+ messages in thread
From: Uwe Kleine-König @ 2023-09-27 19:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano
Cc: Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Amit Kucheria,
Zhang Rui, Alim Akhtar, linux-pm, linux-samsung-soc,
linux-arm-kernel, 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/samsung/exynos_tmu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index e5bc2c82010f..123ec81e1943 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1124,7 +1124,7 @@ static int exynos_tmu_probe(struct platform_device *pdev)
return ret;
}
-static int exynos_tmu_remove(struct platform_device *pdev)
+static void exynos_tmu_remove(struct platform_device *pdev)
{
struct exynos_tmu_data *data = platform_get_drvdata(pdev);
@@ -1137,8 +1137,6 @@ static int exynos_tmu_remove(struct platform_device *pdev)
if (!IS_ERR(data->regulator))
regulator_disable(data->regulator);
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -1173,7 +1171,7 @@ static struct platform_driver exynos_tmu_driver = {
.of_match_table = exynos_tmu_match,
},
.probe = exynos_tmu_probe,
- .remove = exynos_tmu_remove,
+ .remove_new = exynos_tmu_remove,
};
module_platform_driver(exynos_tmu_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 25/31] thermal: spear: 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
` (23 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 24/31] thermal: exynos_tmu: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 26/31] thermal: sprd: " Uwe Kleine-König
` (6 subsequent siblings)
31 siblings, 0 replies; 44+ 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, linux-pm, 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/spear_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
index 96d99289799a..60a871998b07 100644
--- a/drivers/thermal/spear_thermal.c
+++ b/drivers/thermal/spear_thermal.c
@@ -150,7 +150,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
return ret;
}
-static int spear_thermal_exit(struct platform_device *pdev)
+static void spear_thermal_exit(struct platform_device *pdev)
{
unsigned int actual_mask = 0;
struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev);
@@ -163,8 +163,6 @@ static int spear_thermal_exit(struct platform_device *pdev)
writel_relaxed(actual_mask & ~stdev->flags, stdev->thermal_base);
clk_disable(stdev->clk);
-
- return 0;
}
static const struct of_device_id spear_thermal_id_table[] = {
@@ -175,7 +173,7 @@ MODULE_DEVICE_TABLE(of, spear_thermal_id_table);
static struct platform_driver spear_thermal_driver = {
.probe = spear_thermal_probe,
- .remove = spear_thermal_exit,
+ .remove_new = spear_thermal_exit,
.driver = {
.name = "spear_thermal",
.pm = &spear_thermal_pm_ops,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 26/31] thermal: sprd: 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
` (24 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 25/31] thermal: spear: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 27/31] thermal: stm: " Uwe Kleine-König
` (5 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Orson Zhai, Baolin Wang, Chunyan Zhang,
linux-pm, 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/sprd_thermal.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/sprd_thermal.c b/drivers/thermal/sprd_thermal.c
index e27c4bdc8912..874192546548 100644
--- a/drivers/thermal/sprd_thermal.c
+++ b/drivers/thermal/sprd_thermal.c
@@ -516,7 +516,7 @@ static int sprd_thm_resume(struct device *dev)
}
#endif
-static int sprd_thm_remove(struct platform_device *pdev)
+static void sprd_thm_remove(struct platform_device *pdev)
{
struct sprd_thermal_data *thm = platform_get_drvdata(pdev);
int i;
@@ -528,7 +528,6 @@ static int sprd_thm_remove(struct platform_device *pdev)
}
clk_disable_unprepare(thm->clk);
- return 0;
}
static const struct of_device_id sprd_thermal_of_match[] = {
@@ -543,7 +542,7 @@ static const struct dev_pm_ops sprd_thermal_pm_ops = {
static struct platform_driver sprd_thermal_driver = {
.probe = sprd_thm_probe,
- .remove = sprd_thm_remove,
+ .remove_new = sprd_thm_remove,
.driver = {
.name = "sprd-thermal",
.pm = &sprd_thermal_pm_ops,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 27/31] thermal: stm: 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
` (25 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 26/31] thermal: sprd: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 28/31] thermal: soctherm: " Uwe Kleine-König
` (4 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Maxime Coquelin, Alexandre Torgue,
Niklas Söderlund, Kunihiko Hayashi, Florian Fainelli,
Rob Herring, Minghao Chi, linux-pm, linux-stm32, linux-arm-kernel,
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/st/stm_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/st/stm_thermal.c b/drivers/thermal/st/stm_thermal.c
index 142a7e5d12f4..34785b9276fc 100644
--- a/drivers/thermal/st/stm_thermal.c
+++ b/drivers/thermal/st/stm_thermal.c
@@ -569,14 +569,12 @@ static int stm_thermal_probe(struct platform_device *pdev)
return ret;
}
-static int stm_thermal_remove(struct platform_device *pdev)
+static void stm_thermal_remove(struct platform_device *pdev)
{
struct stm_thermal_sensor *sensor = platform_get_drvdata(pdev);
stm_thermal_sensor_off(sensor);
thermal_remove_hwmon_sysfs(sensor->th_dev);
-
- return 0;
}
static struct platform_driver stm_thermal_driver = {
@@ -586,7 +584,7 @@ static struct platform_driver stm_thermal_driver = {
.of_match_table = stm_thermal_of_match,
},
.probe = stm_thermal_probe,
- .remove = stm_thermal_remove,
+ .remove_new = stm_thermal_remove,
};
module_platform_driver(stm_thermal_driver);
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 28/31] thermal: soctherm: 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
` (26 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 27/31] thermal: stm: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 29/31] thermal: tegra-bpmp: " Uwe Kleine-König
` (3 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Thierry Reding, Jonathan Hunter,
Niklas Söderlund, Jernej Skrabec, Johan Hovold, linux-pm,
linux-tegra, 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/tegra/soctherm.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c
index ea66cba09e56..e7fe8683bfc5 100644
--- a/drivers/thermal/tegra/soctherm.c
+++ b/drivers/thermal/tegra/soctherm.c
@@ -2219,15 +2219,13 @@ static int tegra_soctherm_probe(struct platform_device *pdev)
return err;
}
-static int tegra_soctherm_remove(struct platform_device *pdev)
+static void tegra_soctherm_remove(struct platform_device *pdev)
{
struct tegra_soctherm *tegra = platform_get_drvdata(pdev);
debugfs_remove_recursive(tegra->debugfs_dir);
soctherm_clk_enable(pdev, false);
-
- return 0;
}
static int __maybe_unused soctherm_suspend(struct device *dev)
@@ -2274,7 +2272,7 @@ static SIMPLE_DEV_PM_OPS(tegra_soctherm_pm, soctherm_suspend, soctherm_resume);
static struct platform_driver tegra_soctherm_driver = {
.probe = tegra_soctherm_probe,
- .remove = tegra_soctherm_remove,
+ .remove_new = tegra_soctherm_remove,
.driver = {
.name = "tegra_soctherm",
.pm = &tegra_soctherm_pm,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 29/31] thermal: tegra-bpmp: 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
` (27 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 28/31] thermal: soctherm: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 30/31] thermal: ti-bandgap: " Uwe Kleine-König
` (2 subsequent siblings)
31 siblings, 0 replies; 44+ 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, Thierry Reding, Jonathan Hunter,
Mikko Perttunen, Niklas Söderlund, linux-pm, linux-tegra,
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/tegra/tegra-bpmp-thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/tegra/tegra-bpmp-thermal.c b/drivers/thermal/tegra/tegra-bpmp-thermal.c
index 4ffc3bb3bf35..72ce14c980cd 100644
--- a/drivers/thermal/tegra/tegra-bpmp-thermal.c
+++ b/drivers/thermal/tegra/tegra-bpmp-thermal.c
@@ -300,13 +300,11 @@ static int tegra_bpmp_thermal_probe(struct platform_device *pdev)
return 0;
}
-static int tegra_bpmp_thermal_remove(struct platform_device *pdev)
+static void tegra_bpmp_thermal_remove(struct platform_device *pdev)
{
struct tegra_bpmp_thermal *tegra = platform_get_drvdata(pdev);
tegra_bpmp_free_mrq(tegra->bpmp, MRQ_THERMAL, tegra);
-
- return 0;
}
static const struct of_device_id tegra_bpmp_thermal_of_match[] = {
@@ -317,7 +315,7 @@ MODULE_DEVICE_TABLE(of, tegra_bpmp_thermal_of_match);
static struct platform_driver tegra_bpmp_thermal_driver = {
.probe = tegra_bpmp_thermal_probe,
- .remove = tegra_bpmp_thermal_remove,
+ .remove_new = tegra_bpmp_thermal_remove,
.driver = {
.name = "tegra-bpmp-thermal",
.of_match_table = tegra_bpmp_thermal_of_match,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 30/31] thermal: ti-bandgap: 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
` (28 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 29/31] thermal: tegra-bpmp: " Uwe Kleine-König
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-28 16:09 ` Dhruva Gole
2023-09-27 19:37 ` [PATCH 31/31] thermal: uniphier: " Uwe Kleine-König
2023-09-27 19:45 ` [PATCH 00/31] thermal: " Rafael J. Wysocki
31 siblings, 1 reply; 44+ messages in thread
From: Uwe Kleine-König @ 2023-09-27 19:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano
Cc: Eduardo Valentin, Keerthy, Amit Kucheria, Zhang Rui, linux-pm,
linux-omap, 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/ti-soc-thermal/ti-bandgap.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index 0c2eb9c6e58b..caadfc61be93 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -1069,7 +1069,7 @@ int ti_bandgap_probe(struct platform_device *pdev)
}
static
-int ti_bandgap_remove(struct platform_device *pdev)
+void ti_bandgap_remove(struct platform_device *pdev)
{
struct ti_bandgap *bgp = platform_get_drvdata(pdev);
int i;
@@ -1098,8 +1098,6 @@ int ti_bandgap_remove(struct platform_device *pdev)
if (TI_BANDGAP_HAS(bgp, TSHUT))
free_irq(gpiod_to_irq(bgp->tshut_gpiod), NULL);
-
- return 0;
}
#ifdef CONFIG_PM_SLEEP
@@ -1283,7 +1281,7 @@ MODULE_DEVICE_TABLE(of, of_ti_bandgap_match);
static struct platform_driver ti_bandgap_sensor_driver = {
.probe = ti_bandgap_probe,
- .remove = ti_bandgap_remove,
+ .remove_new = ti_bandgap_remove,
.driver = {
.name = "ti-soc-thermal",
.pm = DEV_PM_OPS,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [PATCH 31/31] thermal: uniphier: 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
` (29 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 30/31] thermal: ti-bandgap: " 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
31 siblings, 0 replies; 44+ 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, Kunihiko Hayashi, Masami Hiramatsu,
linux-pm, linux-arm-kernel, 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/uniphier_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/uniphier_thermal.c b/drivers/thermal/uniphier_thermal.c
index 6f32ab61d174..274f36358b21 100644
--- a/drivers/thermal/uniphier_thermal.c
+++ b/drivers/thermal/uniphier_thermal.c
@@ -317,14 +317,12 @@ static int uniphier_tm_probe(struct platform_device *pdev)
return 0;
}
-static int uniphier_tm_remove(struct platform_device *pdev)
+static void uniphier_tm_remove(struct platform_device *pdev)
{
struct uniphier_tm_dev *tdev = platform_get_drvdata(pdev);
/* disable sensor */
uniphier_tm_disable_sensor(tdev);
-
- return 0;
}
static const struct uniphier_tm_soc_data uniphier_pxs2_tm_data = {
@@ -362,7 +360,7 @@ MODULE_DEVICE_TABLE(of, uniphier_tm_dt_ids);
static struct platform_driver uniphier_tm_driver = {
.probe = uniphier_tm_probe,
- .remove = uniphier_tm_remove,
+ .remove_new = uniphier_tm_remove,
.driver = {
.name = "uniphier-thermal",
.of_match_table = uniphier_tm_dt_ids,
--
2.40.1
^ permalink raw reply related [flat|nested] 44+ messages in thread
* Re: [PATCH 20/31] thermal: rcar_gen3: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 20/31] thermal: rcar_gen3: " Uwe Kleine-König
@ 2023-09-27 19:40 ` Wolfram Sang
2023-09-28 8:21 ` Geert Uytterhoeven
2023-09-28 15:26 ` Niklas Söderlund
2 siblings, 0 replies; 44+ messages in thread
From: Wolfram Sang @ 2023-09-27 19:40 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Rafael J. Wysocki, Daniel Lezcano, Niklas Söderlund,
Amit Kucheria, Zhang Rui, linux-renesas-soc, linux-pm, kernel
[-- Attachment #1: Type: text/plain, Size: 908 bytes --]
On Wed, Sep 27, 2023 at 09:37:25PM +0200, Uwe Kleine-König wrote:
> 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: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 21/31] thermal: rcar: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 21/31] thermal: rcar: " Uwe Kleine-König
@ 2023-09-27 19:40 ` Wolfram Sang
2023-09-28 8:22 ` Geert Uytterhoeven
2023-09-28 15:26 ` Niklas Söderlund
2 siblings, 0 replies; 44+ messages in thread
From: Wolfram Sang @ 2023-09-27 19:40 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Rafael J. Wysocki, Daniel Lezcano, Niklas Söderlund,
Amit Kucheria, Zhang Rui, linux-renesas-soc, linux-pm, kernel
[-- Attachment #1: Type: text/plain, Size: 908 bytes --]
On Wed, Sep 27, 2023 at 09:37:26PM +0200, Uwe Kleine-König wrote:
> 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: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 44+ 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
` (30 preceding siblings ...)
2023-09-27 19:37 ` [PATCH 31/31] thermal: uniphier: " Uwe Kleine-König
@ 2023-09-27 19:45 ` Rafael J. Wysocki
2023-09-28 7:05 ` Daniel Lezcano
31 siblings, 1 reply; 44+ 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
>
^ permalink raw reply [flat|nested] 44+ 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; 44+ 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
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 20/31] thermal: rcar_gen3: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 20/31] thermal: rcar_gen3: " Uwe Kleine-König
2023-09-27 19:40 ` Wolfram Sang
@ 2023-09-28 8:21 ` Geert Uytterhoeven
2023-09-28 15:26 ` Niklas Söderlund
2 siblings, 0 replies; 44+ messages in thread
From: Geert Uytterhoeven @ 2023-09-28 8:21 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Rafael J. Wysocki, Daniel Lezcano, Niklas Söderlund,
Amit Kucheria, Zhang Rui, linux-renesas-soc, linux-pm, kernel
On Wed, Sep 27, 2023 at 9:49 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> 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: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 21/31] thermal: rcar: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 21/31] thermal: rcar: " Uwe Kleine-König
2023-09-27 19:40 ` Wolfram Sang
@ 2023-09-28 8:22 ` Geert Uytterhoeven
2023-09-28 15:26 ` Niklas Söderlund
2 siblings, 0 replies; 44+ messages in thread
From: Geert Uytterhoeven @ 2023-09-28 8:22 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Rafael J. Wysocki, Daniel Lezcano, Niklas Söderlund,
Amit Kucheria, Zhang Rui, linux-renesas-soc, linux-pm, kernel
On Wed, Sep 27, 2023 at 9:42 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> 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: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 18/31] thermal: lvts: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 18/31] thermal: lvts: " Uwe Kleine-König
@ 2023-09-28 11:13 ` AngeloGioacchino Del Regno
0 siblings, 0 replies; 44+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-09-28 11:13 UTC (permalink / raw)
To: Uwe Kleine-König, Rafael J. Wysocki, Daniel Lezcano
Cc: Amit Kucheria, Zhang Rui, Matthias Brugger,
Nícolas F. R. A. Prado, Alexandre Mergnat, Balsam CHIHI,
Chen-Yu Tsai, Chen Jiahao, linux-pm, kernel, linux-arm-kernel,
linux-mediatek
Il 27/09/23 21:37, Uwe Kleine-König ha scritto:
> 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: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 20/31] thermal: rcar_gen3: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 20/31] thermal: rcar_gen3: " Uwe Kleine-König
2023-09-27 19:40 ` Wolfram Sang
2023-09-28 8:21 ` Geert Uytterhoeven
@ 2023-09-28 15:26 ` Niklas Söderlund
2 siblings, 0 replies; 44+ messages in thread
From: Niklas Söderlund @ 2023-09-28 15:26 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
linux-renesas-soc, linux-pm, kernel
On 2023-09-27 21:37:25 +0200, Uwe Kleine-König wrote:
> 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: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> drivers/thermal/rcar_gen3_thermal.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
> index bd2fb8c2e968..cafcb6d6e235 100644
> --- a/drivers/thermal/rcar_gen3_thermal.c
> +++ b/drivers/thermal/rcar_gen3_thermal.c
> @@ -432,14 +432,12 @@ static const struct of_device_id rcar_gen3_thermal_dt_ids[] = {
> };
> MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids);
>
> -static int rcar_gen3_thermal_remove(struct platform_device *pdev)
> +static void rcar_gen3_thermal_remove(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
>
> pm_runtime_put(dev);
> pm_runtime_disable(dev);
> -
> - return 0;
> }
>
> static void rcar_gen3_hwmon_action(void *data)
> @@ -594,7 +592,7 @@ static struct platform_driver rcar_gen3_thermal_driver = {
> .of_match_table = rcar_gen3_thermal_dt_ids,
> },
> .probe = rcar_gen3_thermal_probe,
> - .remove = rcar_gen3_thermal_remove,
> + .remove_new = rcar_gen3_thermal_remove,
> };
> module_platform_driver(rcar_gen3_thermal_driver);
>
> --
> 2.40.1
>
--
Kind Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 21/31] thermal: rcar: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 21/31] thermal: rcar: " Uwe Kleine-König
2023-09-27 19:40 ` Wolfram Sang
2023-09-28 8:22 ` Geert Uytterhoeven
@ 2023-09-28 15:26 ` Niklas Söderlund
2 siblings, 0 replies; 44+ messages in thread
From: Niklas Söderlund @ 2023-09-28 15:26 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
linux-renesas-soc, linux-pm, kernel
On 2023-09-27 21:37:26 +0200, Uwe Kleine-König wrote:
> 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: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> drivers/thermal/rcar_thermal.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 293f8dd9fe0a..feb848d595fa 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -371,7 +371,7 @@ static irqreturn_t rcar_thermal_irq(int irq, void *data)
> /*
> * platform functions
> */
> -static int rcar_thermal_remove(struct platform_device *pdev)
> +static void rcar_thermal_remove(struct platform_device *pdev)
> {
> struct rcar_thermal_common *common = platform_get_drvdata(pdev);
> struct device *dev = &pdev->dev;
> @@ -388,8 +388,6 @@ static int rcar_thermal_remove(struct platform_device *pdev)
>
> pm_runtime_put(dev);
> pm_runtime_disable(dev);
> -
> - return 0;
> }
>
> static int rcar_thermal_probe(struct platform_device *pdev)
> @@ -581,7 +579,7 @@ static struct platform_driver rcar_thermal_driver = {
> .of_match_table = rcar_thermal_dt_ids,
> },
> .probe = rcar_thermal_probe,
> - .remove = rcar_thermal_remove,
> + .remove_new = rcar_thermal_remove,
> };
> module_platform_driver(rcar_thermal_driver);
>
> --
> 2.40.1
>
--
Kind Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 30/31] thermal: ti-bandgap: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 30/31] thermal: ti-bandgap: " Uwe Kleine-König
@ 2023-09-28 16:09 ` Dhruva Gole
0 siblings, 0 replies; 44+ messages in thread
From: Dhruva Gole @ 2023-09-28 16:09 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Rafael J. Wysocki, Daniel Lezcano, Eduardo Valentin, Keerthy,
Amit Kucheria, Zhang Rui, linux-pm, linux-omap, kernel
On Sep 27, 2023 at 21:37:35 +0200, Uwe Kleine-König wrote:
> 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/ti-soc-thermal/ti-bandgap.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> index 0c2eb9c6e58b..caadfc61be93 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> @@ -1069,7 +1069,7 @@ int ti_bandgap_probe(struct platform_device *pdev)
> }
>
> static
> -int ti_bandgap_remove(struct platform_device *pdev)
> +void ti_bandgap_remove(struct platform_device *pdev)
> {
> struct ti_bandgap *bgp = platform_get_drvdata(pdev);
> int i;
> @@ -1098,8 +1098,6 @@ int ti_bandgap_remove(struct platform_device *pdev)
>
> if (TI_BANDGAP_HAS(bgp, TSHUT))
> free_irq(gpiod_to_irq(bgp->tshut_gpiod), NULL);
> -
> - return 0;
> }
>
> #ifdef CONFIG_PM_SLEEP
> @@ -1283,7 +1281,7 @@ MODULE_DEVICE_TABLE(of, of_ti_bandgap_match);
>
> static struct platform_driver ti_bandgap_sensor_driver = {
> .probe = ti_bandgap_probe,
> - .remove = ti_bandgap_remove,
> + .remove_new = ti_bandgap_remove,
LGTM,
Reviewed-by: Dhruva Gole <d-gole@ti.com>
> .driver = {
> .name = "ti-soc-thermal",
> .pm = DEV_PM_OPS,
> --
> 2.40.1
>
--
Best regards,
Dhruva Gole <d-gole@ti.com>
^ permalink raw reply [flat|nested] 44+ messages in thread
* Re: [PATCH 02/31] thermal: armada: Convert to platform remove callback returning void
2023-09-27 19:37 ` [PATCH 02/31] thermal: armada: " Uwe Kleine-König
@ 2023-10-01 16:09 ` Miquel Raynal
0 siblings, 0 replies; 44+ messages in thread
From: Miquel Raynal @ 2023-10-01 16:09 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
linux-pm, kernel
Hi Uwe,
u.kleine-koenig@pengutronix.de wrote on Wed, 27 Sep 2023 21:37:07 +0200:
> 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: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 44+ 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; 44+ 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>
^ permalink raw reply [flat|nested] 44+ messages in thread
end of thread, other threads:[~2023-10-01 22:53 UTC | newest]
Thread overview: 44+ 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:37 ` [PATCH 02/31] thermal: armada: " Uwe Kleine-König
2023-10-01 16:09 ` Miquel Raynal
2023-09-27 19:37 ` [PATCH 03/31] thermal: bcm2835: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 04/31] thermal: ns: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 05/31] thermal: da9062: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 06/31] thermal: dove: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 07/31] thermal: hisi: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 08/31] thermal: imx8mm: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 09/31] thermal: imx: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 10/31] thermal: int3400: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 11/31] thermal: int3401: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 12/31] thermal: int3402: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 13/31] thermal: int3403: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 14/31] thermal: int3406: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 15/31] thermal: k3_bandgap: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 16/31] thermal: k3_j72xx_bandgap: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 17/31] thermal: kirkwood: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 18/31] thermal: lvts: " Uwe Kleine-König
2023-09-28 11:13 ` AngeloGioacchino Del Regno
2023-09-27 19:37 ` [PATCH 19/31] thermal: tsens: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 20/31] thermal: rcar_gen3: " Uwe Kleine-König
2023-09-27 19:40 ` Wolfram Sang
2023-09-28 8:21 ` Geert Uytterhoeven
2023-09-28 15:26 ` Niklas Söderlund
2023-09-27 19:37 ` [PATCH 21/31] thermal: rcar: " Uwe Kleine-König
2023-09-27 19:40 ` Wolfram Sang
2023-09-28 8:22 ` Geert Uytterhoeven
2023-09-28 15:26 ` Niklas Söderlund
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:37 ` [PATCH 23/31] thermal: rzg2l: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 24/31] thermal: exynos_tmu: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 25/31] thermal: spear: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 26/31] thermal: sprd: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 27/31] thermal: stm: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 28/31] thermal: soctherm: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 29/31] thermal: tegra-bpmp: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 30/31] thermal: ti-bandgap: " Uwe Kleine-König
2023-09-28 16:09 ` Dhruva Gole
2023-09-27 19:37 ` [PATCH 31/31] thermal: uniphier: " 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;
as well as URLs for NNTP newsgroup(s).