* [PATCH 03/31] thermal: bcm2835: Convert to platform remove callback returning void
[not found] <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de>
@ 2023-09-27 19:37 ` Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 08/31] thermal: imx8mm: " Uwe Kleine-König
` (6 subsequent siblings)
7 siblings, 0 replies; 10+ 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 08/31] thermal: imx8mm: Convert to platform remove callback returning void
[not found] <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de>
2023-09-27 19:37 ` [PATCH 03/31] thermal: bcm2835: 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 09/31] thermal: imx: " Uwe Kleine-König
` (5 subsequent siblings)
7 siblings, 0 replies; 10+ 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 09/31] thermal: imx: Convert to platform remove callback returning void
[not found] <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de>
2023-09-27 19:37 ` [PATCH 03/31] thermal: bcm2835: Convert to platform remove callback returning void Uwe Kleine-König
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 18/31] thermal: lvts: " Uwe Kleine-König
` (4 subsequent siblings)
7 siblings, 0 replies; 10+ 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 18/31] thermal: lvts: Convert to platform remove callback returning void
[not found] <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de>
` (2 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-28 11:13 ` AngeloGioacchino Del Regno
2023-09-27 19:37 ` [PATCH 22/31] thermal: rockchip: " Uwe Kleine-König
` (3 subsequent siblings)
7 siblings, 1 reply; 10+ 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 22/31] thermal: rockchip: Convert to platform remove callback returning void
[not found] <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de>
` (3 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-10-01 22:53 ` Heiko Stuebner
2023-09-27 19:37 ` [PATCH 24/31] thermal: exynos_tmu: " Uwe Kleine-König
` (2 subsequent siblings)
7 siblings, 1 reply; 10+ messages in thread
From: Uwe Kleine-König @ 2023-09-27 19:37 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano
Cc: Amit Kucheria, Zhang Rui, Heiko Stuebner, linux-pm,
linux-arm-kernel, linux-rockchip, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/thermal/rockchip_thermal.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 77231a9d28ff..086ed42dd16c 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -1601,7 +1601,7 @@ static int rockchip_thermal_probe(struct platform_device *pdev)
return 0;
}
-static int rockchip_thermal_remove(struct platform_device *pdev)
+static void rockchip_thermal_remove(struct platform_device *pdev)
{
struct rockchip_thermal_data *thermal = platform_get_drvdata(pdev);
int i;
@@ -1614,8 +1614,6 @@ static int rockchip_thermal_remove(struct platform_device *pdev)
}
thermal->chip->control(thermal->regs, false);
-
- return 0;
}
static int __maybe_unused rockchip_thermal_suspend(struct device *dev)
@@ -1691,7 +1689,7 @@ static struct platform_driver rockchip_thermal_driver = {
.of_match_table = of_rockchip_thermal_match,
},
.probe = rockchip_thermal_probe,
- .remove = rockchip_thermal_remove,
+ .remove_new = rockchip_thermal_remove,
};
module_platform_driver(rockchip_thermal_driver);
--
2.40.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 24/31] thermal: exynos_tmu: Convert to platform remove callback returning void
[not found] <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de>
` (4 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 27/31] thermal: stm: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 31/31] thermal: uniphier: " Uwe Kleine-König
7 siblings, 0 replies; 10+ 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 27/31] thermal: stm: Convert to platform remove callback returning void
[not found] <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de>
` (5 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 31/31] thermal: uniphier: " Uwe Kleine-König
7 siblings, 0 replies; 10+ 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 31/31] thermal: uniphier: Convert to platform remove callback returning void
[not found] <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de>
` (6 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
7 siblings, 0 replies; 10+ 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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 10+ 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; 10+ 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>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ 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; 10+ messages in thread
From: Heiko Stuebner @ 2023-10-01 22:53 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Uwe Kleine-König
Cc: Amit Kucheria, Zhang Rui, linux-pm, linux-arm-kernel,
linux-rockchip, kernel
Am Mittwoch, 27. September 2023, 21:37:27 CEST schrieb Uwe Kleine-König:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
>
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new(), which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-10-01 22:54 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20230927193736.2236447-1-u.kleine-koenig@pengutronix.de>
2023-09-27 19:37 ` [PATCH 03/31] thermal: bcm2835: Convert to platform remove callback returning void 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 18/31] thermal: lvts: " Uwe Kleine-König
2023-09-28 11:13 ` AngeloGioacchino Del Regno
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 24/31] thermal: exynos_tmu: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 27/31] thermal: stm: " Uwe Kleine-König
2023-09-27 19:37 ` [PATCH 31/31] thermal: uniphier: " Uwe Kleine-König
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).