All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/27] thermal/drivers/amlogic: Convert to platform remove callback returning void
@ 2023-07-12  8:12 ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Guillaume La Roque, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-amlogic, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/thermal/amlogic_thermal.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index 756b218880a7..a95c8959e5af 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -293,11 +293,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)
@@ -324,7 +324,7 @@ static struct platform_driver amlogic_thermal_driver = {
 		.of_match_table = of_amlogic_thermal_match,
 	},
 	.probe	= amlogic_thermal_probe,
-	.remove	= amlogic_thermal_remove,
+	.remove_new = amlogic_thermal_remove,
 };
 
 module_platform_driver(amlogic_thermal_driver);
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 01/27] thermal/drivers/amlogic: Convert to platform remove callback returning void
@ 2023-07-12  8:12 ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Guillaume La Roque, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-amlogic, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/thermal/amlogic_thermal.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
index 756b218880a7..a95c8959e5af 100644
--- a/drivers/thermal/amlogic_thermal.c
+++ b/drivers/thermal/amlogic_thermal.c
@@ -293,11 +293,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)
@@ -324,7 +324,7 @@ static struct platform_driver amlogic_thermal_driver = {
 		.of_match_table = of_amlogic_thermal_match,
 	},
 	.probe	= amlogic_thermal_probe,
-	.remove	= amlogic_thermal_remove,
+	.remove_new = amlogic_thermal_remove,
 };
 
 module_platform_driver(amlogic_thermal_driver);
-- 
2.39.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 02/27] thermal/drivers/armada: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  2023-07-12  8:46   ` Miquel Raynal
  2023-07-12 12:44   ` Uwe Kleine-König
  -1 siblings, 2 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Miquel Raynal, Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria,
	Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 9f6dc4fc9112..94783e374d37 100644
--- a/drivers/thermal/armada_thermal.c
+++ b/drivers/thermal/armada_thermal.c
@@ -964,19 +964,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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 03/27] thermal/drivers/broadcom: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
@ 2023-07-12  8:12   ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-rpi-kernel,
	linux-arm-kernel, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 03/27] thermal/drivers/broadcom: Convert to platform remove callback returning void
@ 2023-07-12  8:12   ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-rpi-kernel,
	linux-arm-kernel, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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.39.0


_______________________________________________
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] 54+ messages in thread

* [PATCH 04/27] drivers/thermal/rcar_gen3_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (2 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  2023-07-12 10:07   ` Uwe Kleine-König
                     ` (2 more replies)
  -1 siblings, 3 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Niklas Söderlund, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-renesas-soc, linux-pm,
	linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 9029d01e029b..1405163caa34 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 05/27] thermal/drivers/imx8mm_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
@ 2023-07-12  8:12   ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
	linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 d4b40869c7d7..b95564ad6319 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -366,7 +366,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);
 
@@ -375,8 +375,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 = {
@@ -404,7 +402,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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 05/27] thermal/drivers/imx8mm_thermal: Convert to platform remove callback returning void
@ 2023-07-12  8:12   ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
	linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 d4b40869c7d7..b95564ad6319 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -366,7 +366,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);
 
@@ -375,8 +375,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 = {
@@ -404,7 +402,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.39.0


_______________________________________________
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] 54+ messages in thread

* [PATCH 06/27] thermal/drivers/mediatek/lvts_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
@ 2023-07-12  8:12   ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 b693fac2d677..5dfa69c7669e 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -1158,7 +1158,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;
@@ -1169,8 +1169,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[] = {
@@ -1271,7 +1269,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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 06/27] thermal/drivers/mediatek/lvts_thermal: Convert to platform remove callback returning void
@ 2023-07-12  8:12   ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Matthias Brugger, AngeloGioacchino Del Regno
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 b693fac2d677..5dfa69c7669e 100644
--- a/drivers/thermal/mediatek/lvts_thermal.c
+++ b/drivers/thermal/mediatek/lvts_thermal.c
@@ -1158,7 +1158,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;
@@ -1169,8 +1169,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[] = {
@@ -1271,7 +1269,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.39.0


_______________________________________________
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] 54+ messages in thread

* [PATCH 07/27] thermal/drivers/qcom: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (5 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Amit Kucheria, Thara Gopinath, Andy Gross, Bjorn Andersson,
	Konrad Dybcio, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-arm-msm, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 08/27] thermal/drivers/hisi: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (6 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 3f09ef8be41a..855ccd6b8b13 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 09/27] thermal/drivers/spear: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (7 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 6e78616a576e..843fa5c8e7c8 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 10/27] thermal/drivers/rockchip: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
  (?)
@ 2023-07-12  8:12   ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Heiko Stuebner
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
	linux-rockchip, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 10/27] thermal/drivers/rockchip: Convert to platform remove callback returning void
@ 2023-07-12  8:12   ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Heiko Stuebner
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
	linux-rockchip, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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.39.0


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 10/27] thermal/drivers/rockchip: Convert to platform remove callback returning void
@ 2023-07-12  8:12   ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Heiko Stuebner
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
	linux-rockchip, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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.39.0


_______________________________________________
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] 54+ messages in thread

* [PATCH 11/27] thermal/drivers/uniphier: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
@ 2023-07-12  8:12   ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Kunihiko Hayashi, Masami Hiramatsu
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
	linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 aef6119cc004..a5320ec9939c 100644
--- a/drivers/thermal/uniphier_thermal.c
+++ b/drivers/thermal/uniphier_thermal.c
@@ -318,14 +318,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 = {
@@ -363,7 +361,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.39.0


_______________________________________________
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] 54+ messages in thread

* [PATCH 11/27] thermal/drivers/uniphier: Convert to platform remove callback returning void
@ 2023-07-12  8:12   ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Kunihiko Hayashi, Masami Hiramatsu
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
	linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 aef6119cc004..a5320ec9939c 100644
--- a/drivers/thermal/uniphier_thermal.c
+++ b/drivers/thermal/uniphier_thermal.c
@@ -318,14 +318,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 = {
@@ -363,7 +361,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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 12/27] thermal/drivers/dove: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (10 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 9954040d1d2c..526c96fd4cc5 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 13/27] thermal/drivers/k3_j72xx_bandgap: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (11 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 5be1f09eeb2c..62e24d08f408 100644
--- a/drivers/thermal/k3_j72xx_bandgap.c
+++ b/drivers/thermal/k3_j72xx_bandgap.c
@@ -523,12 +523,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 = {
@@ -554,7 +552,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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 14/27] thermal/drivers/tegra-bpmp: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (12 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Thierry Reding, Jonathan Hunter
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-tegra, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 a2879d624945..5a41c200deae 100644
--- a/drivers/thermal/tegra/tegra-bpmp-thermal.c
+++ b/drivers/thermal/tegra/tegra-bpmp-thermal.c
@@ -250,13 +250,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[] = {
@@ -267,7 +265,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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 15/27] thermal/drivers/imx: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
@ 2023-07-12  8:12   ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
	linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 a94ec0a0c9dd..0f033c2ca0ad 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.39.0


_______________________________________________
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] 54+ messages in thread

* [PATCH 15/27] thermal/drivers/imx: Convert to platform remove callback returning void
@ 2023-07-12  8:12   ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Shawn Guo, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
	linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 a94ec0a0c9dd..0f033c2ca0ad 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 16/27] thermal/drivers/da9062: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (14 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Support Opensource, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 17/27] thermal/drivers/broadcom: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (15 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 18/27] thermal/drivers/rzg2l: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (16 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 b56981f85306..a723eaff78e5 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 19/27] drivers/thermal/k3: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (17 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 1c3e590157ec..ae03c5bdb5f1 100644
--- a/drivers/thermal/k3_bandgap.c
+++ b/drivers/thermal/k3_bandgap.c
@@ -236,12 +236,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[] = {
@@ -254,7 +252,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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 20/27] thermal/drivers/sprd: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (18 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Orson Zhai, Baolin Wang, Chunyan Zhang
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 2fb90fdad76e..0546096f7e2d 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 21/27] thermal/drivers/rcar_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (19 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  2023-07-12 11:43   ` Geert Uytterhoeven
                     ` (2 more replies)
  -1 siblings, 3 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Niklas Söderlund, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-renesas-soc, linux-pm,
	linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 b8571f7090aa..b4c58c5f6f6d 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 22/27] thermal/ti-soc-thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (20 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Eduardo Valentin, Keerthy, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-omap, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/thermal/ti-soc-thermal/ti-bandgap.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
index a1c9a1530183..6c23f2095631 100644
--- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
+++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
@@ -1068,8 +1068,7 @@ int ti_bandgap_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static
-int ti_bandgap_remove(struct platform_device *pdev)
+static void ti_bandgap_remove(struct platform_device *pdev)
 {
 	struct ti_bandgap *bgp = platform_get_drvdata(pdev);
 	int i;
@@ -1098,8 +1097,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 +1280,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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 23/27] thermal/drivers/stm: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
@ 2023-07-12  8:12   ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Maxime Coquelin, Alexandre Torgue
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-stm32,
	linux-arm-kernel, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 903fcf1763f1..da6a25ce4469 100644
--- a/drivers/thermal/st/stm_thermal.c
+++ b/drivers/thermal/st/stm_thermal.c
@@ -571,14 +571,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 = {
@@ -588,7 +586,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.39.0


_______________________________________________
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] 54+ messages in thread

* [PATCH 23/27] thermal/drivers/stm: Convert to platform remove callback returning void
@ 2023-07-12  8:12   ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Maxime Coquelin, Alexandre Torgue
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-stm32,
	linux-arm-kernel, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 903fcf1763f1..da6a25ce4469 100644
--- a/drivers/thermal/st/stm_thermal.c
+++ b/drivers/thermal/st/stm_thermal.c
@@ -571,14 +571,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 = {
@@ -588,7 +586,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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 24/27] thermal/drivers/tegra-soctherm: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (22 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Thierry Reding, Jonathan Hunter
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-tegra, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 25/27] thermal/drivers/exynos: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
@ 2023-07-12  8:12   ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski,
	Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Alim Akhtar
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-samsung-soc,
	linux-arm-kernel, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 45e5c840d130..576ad558cfb7 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.39.0


_______________________________________________
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] 54+ messages in thread

* [PATCH 25/27] thermal/drivers/exynos: Convert to platform remove callback returning void
@ 2023-07-12  8:12   ` Yangtao Li
  0 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski,
	Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Alim Akhtar
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-samsung-soc,
	linux-arm-kernel, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 45e5c840d130..576ad558cfb7 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 26/27] thermal/drivers/kirkwood: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (24 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  -1 siblings, 0 replies; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 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 668747bd86ef..94c95870f277 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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* [PATCH 27/27] thermal: intel: int340x: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
                   ` (25 preceding siblings ...)
  (?)
@ 2023-07-12  8:12 ` Yangtao Li
  2023-07-14 19:01   ` Rafael J. Wysocki
  -1 siblings, 1 reply; 54+ messages in thread
From: Yangtao Li @ 2023-07-12  8:12 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui
  Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-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 (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 5 ++---
 drivers/thermal/intel/int340x_thermal/int3401_thermal.c | 6 ++----
 drivers/thermal/intel/int340x_thermal/int3402_thermal.c | 6 ++----
 drivers/thermal/intel/int340x_thermal/int3403_thermal.c | 6 ++----
 drivers/thermal/intel/int340x_thermal/int3406_thermal.c | 5 ++---
 5 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 5e1164226ada..8fbc97641740 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),
diff --git a/drivers/thermal/intel/int340x_thermal/int3401_thermal.c b/drivers/thermal/intel/int340x_thermal/int3401_thermal.c
index 217786fba185..714f4cb59cfd 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,
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,
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,
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.39.0


^ permalink raw reply related	[flat|nested] 54+ messages in thread

* Re: [PATCH 02/27] thermal/drivers/armada: Convert to platform remove callback returning void
  2023-07-12  8:12 ` [PATCH 02/27] thermal/drivers/armada: " Yangtao Li
@ 2023-07-12  8:46   ` Miquel Raynal
  2023-07-12 12:44   ` Uwe Kleine-König
  1 sibling, 0 replies; 54+ messages in thread
From: Miquel Raynal @ 2023-07-12  8:46 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Uwe Kleine-König, linux-pm, linux-kernel

Hi Yangtao,

frank.li@vivo.com wrote on Wed, 12 Jul 2023 16:12:33 +0800:

> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>

> ---
>  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 9f6dc4fc9112..94783e374d37 100644
> --- a/drivers/thermal/armada_thermal.c
> +++ b/drivers/thermal/armada_thermal.c
> @@ -964,19 +964,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,


Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 01/27] thermal/drivers/amlogic: Convert to platform remove callback returning void
  2023-07-12  8:12 ` Yangtao Li
@ 2023-07-12 10:05   ` Uwe Kleine-König
  -1 siblings, 0 replies; 54+ messages in thread
From: Uwe Kleine-König @ 2023-07-12 10:05 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Guillaume La Roque, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui, linux-pm, linux-amlogic, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1746 bytes --]

On Wed, Jul 12, 2023 at 04:12:32PM +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  drivers/thermal/amlogic_thermal.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
> index 756b218880a7..a95c8959e5af 100644
> --- a/drivers/thermal/amlogic_thermal.c
> +++ b/drivers/thermal/amlogic_thermal.c
> @@ -293,11 +293,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);

I'd make amlogic_thermal_disable() return void, too.

Otherwise looks ok.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 01/27] thermal/drivers/amlogic: Convert to platform remove callback returning void
@ 2023-07-12 10:05   ` Uwe Kleine-König
  0 siblings, 0 replies; 54+ messages in thread
From: Uwe Kleine-König @ 2023-07-12 10:05 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Guillaume La Roque, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui, linux-pm, linux-amlogic, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1746 bytes --]

On Wed, Jul 12, 2023 at 04:12:32PM +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  drivers/thermal/amlogic_thermal.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_thermal.c
> index 756b218880a7..a95c8959e5af 100644
> --- a/drivers/thermal/amlogic_thermal.c
> +++ b/drivers/thermal/amlogic_thermal.c
> @@ -293,11 +293,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);

I'd make amlogic_thermal_disable() return void, too.

Otherwise looks ok.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 03/27] thermal/drivers/broadcom: Convert to platform remove callback returning void
  2023-07-12  8:12   ` Yangtao Li
@ 2023-07-12 10:06     ` Uwe Kleine-König
  -1 siblings, 0 replies; 54+ messages in thread
From: Uwe Kleine-König @ 2023-07-12 10:06 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, linux-pm, linux-rpi-kernel, linux-arm-kernel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

On Wed, Jul 12, 2023 at 04:12:34PM +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 03/27] thermal/drivers/broadcom: Convert to platform remove callback returning void
@ 2023-07-12 10:06     ` Uwe Kleine-König
  0 siblings, 0 replies; 54+ messages in thread
From: Uwe Kleine-König @ 2023-07-12 10:06 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, linux-pm, linux-rpi-kernel, linux-arm-kernel,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 978 bytes --]

On Wed, Jul 12, 2023 at 04:12:34PM +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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] 54+ messages in thread

* Re: [PATCH 04/27] drivers/thermal/rcar_gen3_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` [PATCH 04/27] drivers/thermal/rcar_gen3_thermal: " Yangtao Li
@ 2023-07-12 10:07   ` Uwe Kleine-König
  2023-07-12 11:44   ` Geert Uytterhoeven
  2023-07-12 13:22   ` Niklas Söderlund
  2 siblings, 0 replies; 54+ messages in thread
From: Uwe Kleine-König @ 2023-07-12 10:07 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Niklas Söderlund, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui, linux-renesas-soc, linux-pm,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 999 bytes --]

On Wed, Jul 12, 2023 at 04:12:35PM +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 06/27] thermal/drivers/mediatek/lvts_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12   ` Yangtao Li
@ 2023-07-12 10:14     ` Uwe Kleine-König
  -1 siblings, 0 replies; 54+ messages in thread
From: Uwe Kleine-König @ 2023-07-12 10:14 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-pm,
	linux-kernel, linux-arm-kernel, linux-mediatek

[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]

On Wed, Jul 12, 2023 at 04:12:37PM +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

While I like like you picking up the quest of converting drivers, I'd
like to have some coordination in place to not let us do duplicate work.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 06/27] thermal/drivers/mediatek/lvts_thermal: Convert to platform remove callback returning void
@ 2023-07-12 10:14     ` Uwe Kleine-König
  0 siblings, 0 replies; 54+ messages in thread
From: Uwe Kleine-König @ 2023-07-12 10:14 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-pm,
	linux-kernel, linux-arm-kernel, linux-mediatek


[-- Attachment #1.1: Type: text/plain, Size: 1146 bytes --]

On Wed, Jul 12, 2023 at 04:12:37PM +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

While I like like you picking up the quest of converting drivers, I'd
like to have some coordination in place to not let us do duplicate work.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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] 54+ messages in thread

* Re: [PATCH 21/27] thermal/drivers/rcar_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` [PATCH 21/27] thermal/drivers/rcar_thermal: " Yangtao Li
@ 2023-07-12 11:43   ` Geert Uytterhoeven
  2023-07-12 12:49   ` Uwe Kleine-König
  2023-07-12 13:23   ` Niklas Söderlund
  2 siblings, 0 replies; 54+ messages in thread
From: Geert Uytterhoeven @ 2023-07-12 11:43 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Niklas Söderlund, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui, Uwe Kleine-König,
	linux-renesas-soc, linux-pm, linux-kernel

On Wed, Jul 12, 2023 at 10:23 AM Yangtao Li <frank.li@vivo.com> 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

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] 54+ messages in thread

* Re: [PATCH 04/27] drivers/thermal/rcar_gen3_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` [PATCH 04/27] drivers/thermal/rcar_gen3_thermal: " Yangtao Li
  2023-07-12 10:07   ` Uwe Kleine-König
@ 2023-07-12 11:44   ` Geert Uytterhoeven
  2023-07-12 13:22   ` Niklas Söderlund
  2 siblings, 0 replies; 54+ messages in thread
From: Geert Uytterhoeven @ 2023-07-12 11:44 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Niklas Söderlund, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui, Uwe Kleine-König,
	linux-renesas-soc, linux-pm, linux-kernel

On Wed, Jul 12, 2023 at 10:16 AM Yangtao Li <frank.li@vivo.com> 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

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] 54+ messages in thread

* Re: [PATCH 02/27] thermal/drivers/armada: Convert to platform remove callback returning void
  2023-07-12  8:12 ` [PATCH 02/27] thermal/drivers/armada: " Yangtao Li
  2023-07-12  8:46   ` Miquel Raynal
@ 2023-07-12 12:44   ` Uwe Kleine-König
  1 sibling, 0 replies; 54+ messages in thread
From: Uwe Kleine-König @ 2023-07-12 12:44 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Miquel Raynal, Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria,
	Zhang Rui, linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 999 bytes --]

On Wed, Jul 12, 2023 at 04:12:33PM +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 21/27] thermal/drivers/rcar_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` [PATCH 21/27] thermal/drivers/rcar_thermal: " Yangtao Li
  2023-07-12 11:43   ` Geert Uytterhoeven
@ 2023-07-12 12:49   ` Uwe Kleine-König
  2023-07-12 13:23   ` Niklas Söderlund
  2 siblings, 0 replies; 54+ messages in thread
From: Uwe Kleine-König @ 2023-07-12 12:49 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Niklas Söderlund, Rafael J. Wysocki, Daniel Lezcano,
	Amit Kucheria, Zhang Rui, linux-renesas-soc, linux-pm,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

Hello,

On Wed, Jul 12, 2023 at 04:12:52PM +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 04/27] drivers/thermal/rcar_gen3_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` [PATCH 04/27] drivers/thermal/rcar_gen3_thermal: " Yangtao Li
  2023-07-12 10:07   ` Uwe Kleine-König
  2023-07-12 11:44   ` Geert Uytterhoeven
@ 2023-07-12 13:22   ` Niklas Söderlund
  2 siblings, 0 replies; 54+ messages in thread
From: Niklas Söderlund @ 2023-07-12 13:22 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Uwe Kleine-König, linux-renesas-soc, linux-pm, linux-kernel

On 2023-07-12 16:12:35 +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@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 9029d01e029b..1405163caa34 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.39.0
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 21/27] thermal/drivers/rcar_thermal: Convert to platform remove callback returning void
  2023-07-12  8:12 ` [PATCH 21/27] thermal/drivers/rcar_thermal: " Yangtao Li
  2023-07-12 11:43   ` Geert Uytterhoeven
  2023-07-12 12:49   ` Uwe Kleine-König
@ 2023-07-12 13:23   ` Niklas Söderlund
  2 siblings, 0 replies; 54+ messages in thread
From: Niklas Söderlund @ 2023-07-12 13:23 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Uwe Kleine-König, linux-renesas-soc, linux-pm, linux-kernel

On 2023-07-12 16:12:52 +0800, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@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 b8571f7090aa..b4c58c5f6f6d 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.39.0
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 03/27] thermal/drivers/broadcom: Convert to platform remove callback returning void
  2023-07-12  8:12   ` Yangtao Li
@ 2023-07-12 15:38     ` Florian Fainelli
  -1 siblings, 0 replies; 54+ messages in thread
From: Florian Fainelli @ 2023-07-12 15:38 UTC (permalink / raw)
  To: Yangtao Li, Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria,
	Zhang Rui, Broadcom internal kernel review list, Ray Jui,
	Scott Branden
  Cc: Uwe Kleine-König, linux-pm, linux-rpi-kernel,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 798 bytes --]



On 7/12/2023 10:12 AM, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

^ permalink raw reply	[flat|nested] 54+ messages in thread

* Re: [PATCH 03/27] thermal/drivers/broadcom: Convert to platform remove callback returning void
@ 2023-07-12 15:38     ` Florian Fainelli
  0 siblings, 0 replies; 54+ messages in thread
From: Florian Fainelli @ 2023-07-12 15:38 UTC (permalink / raw)
  To: Yangtao Li, Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria,
	Zhang Rui, Broadcom internal kernel review list, Ray Jui,
	Scott Branden
  Cc: Uwe Kleine-König, linux-pm, linux-rpi-kernel,
	linux-arm-kernel, linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 798 bytes --]



On 7/12/2023 10:12 AM, Yangtao Li 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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] 54+ messages in thread

* Re: [PATCH 27/27] thermal: intel: int340x: Convert to platform remove callback returning void
  2023-07-12  8:12 ` [PATCH 27/27] thermal: intel: int340x: " Yangtao Li
@ 2023-07-14 19:01   ` Rafael J. Wysocki
  0 siblings, 0 replies; 54+ messages in thread
From: Rafael J. Wysocki @ 2023-07-14 19:01 UTC (permalink / raw)
  To: Yangtao Li
  Cc: Rafael J. Wysocki, Daniel Lezcano, Amit Kucheria, Zhang Rui,
	Uwe Kleine-König, linux-pm, linux-kernel

On Wed, Jul 12, 2023 at 10:14 AM Yangtao Li <frank.li@vivo.com> 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Signed-off-by: Yangtao Li <frank.li@vivo.com>

Acked-by: Rafael J. Wysocki <rafael@kernel.org>

or please let me know if you want me to pick this up.

Thanks!

> ---
>  drivers/thermal/intel/int340x_thermal/int3400_thermal.c | 5 ++---
>  drivers/thermal/intel/int340x_thermal/int3401_thermal.c | 6 ++----
>  drivers/thermal/intel/int340x_thermal/int3402_thermal.c | 6 ++----
>  drivers/thermal/intel/int340x_thermal/int3403_thermal.c | 6 ++----
>  drivers/thermal/intel/int340x_thermal/int3406_thermal.c | 5 ++---
>  5 files changed, 10 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
> index 5e1164226ada..8fbc97641740 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),
> diff --git a/drivers/thermal/intel/int340x_thermal/int3401_thermal.c b/drivers/thermal/intel/int340x_thermal/int3401_thermal.c
> index 217786fba185..714f4cb59cfd 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,
> 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,
> 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,
> 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.39.0
>

^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2023-07-14 19:01 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-12  8:12 [PATCH 01/27] thermal/drivers/amlogic: Convert to platform remove callback returning void Yangtao Li
2023-07-12  8:12 ` Yangtao Li
2023-07-12  8:12 ` [PATCH 02/27] thermal/drivers/armada: " Yangtao Li
2023-07-12  8:46   ` Miquel Raynal
2023-07-12 12:44   ` Uwe Kleine-König
2023-07-12  8:12 ` [PATCH 03/27] thermal/drivers/broadcom: " Yangtao Li
2023-07-12  8:12   ` Yangtao Li
2023-07-12 10:06   ` Uwe Kleine-König
2023-07-12 10:06     ` Uwe Kleine-König
2023-07-12 15:38   ` Florian Fainelli
2023-07-12 15:38     ` Florian Fainelli
2023-07-12  8:12 ` [PATCH 04/27] drivers/thermal/rcar_gen3_thermal: " Yangtao Li
2023-07-12 10:07   ` Uwe Kleine-König
2023-07-12 11:44   ` Geert Uytterhoeven
2023-07-12 13:22   ` Niklas Söderlund
2023-07-12  8:12 ` [PATCH 05/27] thermal/drivers/imx8mm_thermal: " Yangtao Li
2023-07-12  8:12   ` Yangtao Li
2023-07-12  8:12 ` [PATCH 06/27] thermal/drivers/mediatek/lvts_thermal: " Yangtao Li
2023-07-12  8:12   ` Yangtao Li
2023-07-12 10:14   ` Uwe Kleine-König
2023-07-12 10:14     ` Uwe Kleine-König
2023-07-12  8:12 ` [PATCH 07/27] thermal/drivers/qcom: " Yangtao Li
2023-07-12  8:12 ` [PATCH 08/27] thermal/drivers/hisi: " Yangtao Li
2023-07-12  8:12 ` [PATCH 09/27] thermal/drivers/spear: " Yangtao Li
2023-07-12  8:12 ` [PATCH 10/27] thermal/drivers/rockchip: " Yangtao Li
2023-07-12  8:12   ` Yangtao Li
2023-07-12  8:12   ` Yangtao Li
2023-07-12  8:12 ` [PATCH 11/27] thermal/drivers/uniphier: " Yangtao Li
2023-07-12  8:12   ` Yangtao Li
2023-07-12  8:12 ` [PATCH 12/27] thermal/drivers/dove: " Yangtao Li
2023-07-12  8:12 ` [PATCH 13/27] thermal/drivers/k3_j72xx_bandgap: " Yangtao Li
2023-07-12  8:12 ` [PATCH 14/27] thermal/drivers/tegra-bpmp: " Yangtao Li
2023-07-12  8:12 ` [PATCH 15/27] thermal/drivers/imx: " Yangtao Li
2023-07-12  8:12   ` Yangtao Li
2023-07-12  8:12 ` [PATCH 16/27] thermal/drivers/da9062: " Yangtao Li
2023-07-12  8:12 ` [PATCH 17/27] thermal/drivers/broadcom: " Yangtao Li
2023-07-12  8:12 ` [PATCH 18/27] thermal/drivers/rzg2l: " Yangtao Li
2023-07-12  8:12 ` [PATCH 19/27] drivers/thermal/k3: " Yangtao Li
2023-07-12  8:12 ` [PATCH 20/27] thermal/drivers/sprd: " Yangtao Li
2023-07-12  8:12 ` [PATCH 21/27] thermal/drivers/rcar_thermal: " Yangtao Li
2023-07-12 11:43   ` Geert Uytterhoeven
2023-07-12 12:49   ` Uwe Kleine-König
2023-07-12 13:23   ` Niklas Söderlund
2023-07-12  8:12 ` [PATCH 22/27] thermal/ti-soc-thermal: " Yangtao Li
2023-07-12  8:12 ` [PATCH 23/27] thermal/drivers/stm: " Yangtao Li
2023-07-12  8:12   ` Yangtao Li
2023-07-12  8:12 ` [PATCH 24/27] thermal/drivers/tegra-soctherm: " Yangtao Li
2023-07-12  8:12 ` [PATCH 25/27] thermal/drivers/exynos: " Yangtao Li
2023-07-12  8:12   ` Yangtao Li
2023-07-12  8:12 ` [PATCH 26/27] thermal/drivers/kirkwood: " Yangtao Li
2023-07-12  8:12 ` [PATCH 27/27] thermal: intel: int340x: " Yangtao Li
2023-07-14 19:01   ` Rafael J. Wysocki
2023-07-12 10:05 ` [PATCH 01/27] thermal/drivers/amlogic: " Uwe Kleine-König
2023-07-12 10:05   ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.