* [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void
@ 2023-07-12 9:33 Yangtao Li
2023-07-12 9:33 ` [PATCH 02/19] cpufreq: dt: " Yangtao Li
` (19 more replies)
0 siblings, 20 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Yangtao Li, Rafael J. Wysocki, Viresh Kumar, Chen-Yu Tsai,
Jernej Skrabec, Samuel Holland
Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
linux-sunxi, 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/cpufreq/sun50i-cpufreq-nvmem.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
index 4321d7bbe769..32a9c88f8ff6 100644
--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c
+++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
@@ -137,7 +137,7 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev)
return ret;
}
-static int sun50i_cpufreq_nvmem_remove(struct platform_device *pdev)
+static void sun50i_cpufreq_nvmem_remove(struct platform_device *pdev)
{
int *opp_tokens = platform_get_drvdata(pdev);
unsigned int cpu;
@@ -148,13 +148,11 @@ static int sun50i_cpufreq_nvmem_remove(struct platform_device *pdev)
dev_pm_opp_put_prop_name(opp_tokens[cpu]);
kfree(opp_tokens);
-
- return 0;
}
static struct platform_driver sun50i_cpufreq_driver = {
.probe = sun50i_cpufreq_nvmem_probe,
- .remove = sun50i_cpufreq_nvmem_remove,
+ .remove_new = sun50i_cpufreq_nvmem_remove,
.driver = {
.name = "sun50i-cpufreq-nvmem",
},
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 02/19] cpufreq: dt: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 03/19] cpufreq: qcom-cpufreq-hw: " Yangtao Li
` (18 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar
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/cpufreq/cpufreq-dt.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 4aec4b2a5225..8bd6e5e8f121 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -349,11 +349,10 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
return ret;
}
-static int dt_cpufreq_remove(struct platform_device *pdev)
+static void dt_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&dt_cpufreq_driver);
dt_cpufreq_release();
- return 0;
}
static struct platform_driver dt_cpufreq_platdrv = {
@@ -361,7 +360,7 @@ static struct platform_driver dt_cpufreq_platdrv = {
.name = "cpufreq-dt",
},
.probe = dt_cpufreq_probe,
- .remove = dt_cpufreq_remove,
+ .remove_new = dt_cpufreq_remove,
};
module_platform_driver(dt_cpufreq_platdrv);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 03/19] cpufreq: qcom-cpufreq-hw: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
2023-07-12 9:33 ` [PATCH 02/19] cpufreq: dt: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 04/19] cpufreq: vexpress: " Yangtao Li
` (17 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rafael J. Wysocki,
Viresh Kumar
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/cpufreq/qcom-cpufreq-hw.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
index f2830371d25f..f24cf2eddf1e 100644
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
@@ -730,16 +730,14 @@ static int qcom_cpufreq_hw_driver_probe(struct platform_device *pdev)
return ret;
}
-static int qcom_cpufreq_hw_driver_remove(struct platform_device *pdev)
+static void qcom_cpufreq_hw_driver_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&cpufreq_qcom_hw_driver);
-
- return 0;
}
static struct platform_driver qcom_cpufreq_hw_driver = {
.probe = qcom_cpufreq_hw_driver_probe,
- .remove = qcom_cpufreq_hw_driver_remove,
+ .remove_new = qcom_cpufreq_hw_driver_remove,
.driver = {
.name = "qcom-cpufreq-hw",
.of_match_table = qcom_cpufreq_hw_match,
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 04/19] cpufreq: vexpress: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
2023-07-12 9:33 ` [PATCH 02/19] cpufreq: dt: " Yangtao Li
2023-07-12 9:33 ` [PATCH 03/19] cpufreq: qcom-cpufreq-hw: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-13 13:04 ` Sudeep Holla
2023-07-12 9:33 ` [PATCH 05/19] cpufreq: imx6q: " Yangtao Li
` (16 subsequent siblings)
19 siblings, 1 reply; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Viresh Kumar, Sudeep Holla, Rafael J. Wysocki, Liviu Dudau,
Lorenzo Pieralisi
Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-kernel,
linux-arm-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/cpufreq/vexpress-spc-cpufreq.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/vexpress-spc-cpufreq.c b/drivers/cpufreq/vexpress-spc-cpufreq.c
index d295f405c4bb..cf33e01dfda6 100644
--- a/drivers/cpufreq/vexpress-spc-cpufreq.c
+++ b/drivers/cpufreq/vexpress-spc-cpufreq.c
@@ -552,7 +552,7 @@ static int ve_spc_cpufreq_probe(struct platform_device *pdev)
return ret;
}
-static int ve_spc_cpufreq_remove(struct platform_device *pdev)
+static void ve_spc_cpufreq_remove(struct platform_device *pdev)
{
bL_switcher_get_enabled();
__bLs_unregister_notifier();
@@ -560,7 +560,6 @@ static int ve_spc_cpufreq_remove(struct platform_device *pdev)
bL_switcher_put_enabled();
pr_info("%s: Un-registered platform driver: %s\n", __func__,
ve_spc_cpufreq_driver.name);
- return 0;
}
static struct platform_driver ve_spc_cpufreq_platdrv = {
@@ -568,7 +567,7 @@ static struct platform_driver ve_spc_cpufreq_platdrv = {
.name = "vexpress-spc-cpufreq",
},
.probe = ve_spc_cpufreq_probe,
- .remove = ve_spc_cpufreq_remove,
+ .remove_new = ve_spc_cpufreq_remove,
};
module_platform_driver(ve_spc_cpufreq_platdrv);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 05/19] cpufreq: imx6q: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (2 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 04/19] cpufreq: vexpress: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 06/19] cpufreq: mediatek-hw: " Yangtao Li
` (15 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar, 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/cpufreq/imx6q-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
index 9fb1501033bb..494d044b9e72 100644
--- a/drivers/cpufreq/imx6q-cpufreq.c
+++ b/drivers/cpufreq/imx6q-cpufreq.c
@@ -519,7 +519,7 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
return ret;
}
-static int imx6q_cpufreq_remove(struct platform_device *pdev)
+static void imx6q_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&imx6q_cpufreq_driver);
dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
@@ -530,8 +530,6 @@ static int imx6q_cpufreq_remove(struct platform_device *pdev)
regulator_put(soc_reg);
clk_bulk_put(num_clks, clks);
-
- return 0;
}
static struct platform_driver imx6q_cpufreq_platdrv = {
@@ -539,7 +537,7 @@ static struct platform_driver imx6q_cpufreq_platdrv = {
.name = "imx6q-cpufreq",
},
.probe = imx6q_cpufreq_probe,
- .remove = imx6q_cpufreq_remove,
+ .remove_new = imx6q_cpufreq_remove,
};
module_platform_driver(imx6q_cpufreq_platdrv);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 06/19] cpufreq: mediatek-hw: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (3 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 05/19] cpufreq: imx6q: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 07/19] cpufreq: scpi: " Yangtao Li
` (14 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar, 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/cpufreq/mediatek-cpufreq-hw.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/mediatek-cpufreq-hw.c b/drivers/cpufreq/mediatek-cpufreq-hw.c
index b22f5cc8a463..062250192f42 100644
--- a/drivers/cpufreq/mediatek-cpufreq-hw.c
+++ b/drivers/cpufreq/mediatek-cpufreq-hw.c
@@ -315,11 +315,9 @@ static int mtk_cpufreq_hw_driver_probe(struct platform_device *pdev)
return ret;
}
-static int mtk_cpufreq_hw_driver_remove(struct platform_device *pdev)
+static void mtk_cpufreq_hw_driver_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&cpufreq_mtk_hw_driver);
-
- return 0;
}
static const struct of_device_id mtk_cpufreq_hw_match[] = {
@@ -330,7 +328,7 @@ MODULE_DEVICE_TABLE(of, mtk_cpufreq_hw_match);
static struct platform_driver mtk_cpufreq_hw_driver = {
.probe = mtk_cpufreq_hw_driver_probe,
- .remove = mtk_cpufreq_hw_driver_remove,
+ .remove_new = mtk_cpufreq_hw_driver_remove,
.driver = {
.name = "mtk-cpufreq-hw",
.of_match_table = mtk_cpufreq_hw_match,
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 07/19] cpufreq: scpi: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (4 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 06/19] cpufreq: mediatek-hw: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-13 13:06 ` Sudeep Holla
2023-07-12 9:33 ` [PATCH 08/19] cpufreq: tegra194: " Yangtao Li
` (13 subsequent siblings)
19 siblings, 1 reply; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Sudeep Holla, Cristian Marussi, Rafael J. Wysocki, Viresh Kumar
Cc: Yangtao Li, Uwe Kleine-König, linux-arm-kernel, 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/cpufreq/scpi-cpufreq.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
index fd2c16821d54..28f1e0490af1 100644
--- a/drivers/cpufreq/scpi-cpufreq.c
+++ b/drivers/cpufreq/scpi-cpufreq.c
@@ -208,11 +208,10 @@ static int scpi_cpufreq_probe(struct platform_device *pdev)
return ret;
}
-static int scpi_cpufreq_remove(struct platform_device *pdev)
+static void scpi_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&scpi_cpufreq_driver);
scpi_ops = NULL;
- return 0;
}
static struct platform_driver scpi_cpufreq_platdrv = {
@@ -220,7 +219,7 @@ static struct platform_driver scpi_cpufreq_platdrv = {
.name = "scpi-cpufreq",
},
.probe = scpi_cpufreq_probe,
- .remove = scpi_cpufreq_remove,
+ .remove_new = scpi_cpufreq_remove,
};
module_platform_driver(scpi_cpufreq_platdrv);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 08/19] cpufreq: tegra194: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (5 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 07/19] cpufreq: scpi: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 09/19] cpufreq: brcmstb-avs-cpufreq: " Yangtao Li
` (12 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar, 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/cpufreq/tegra194-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/tegra194-cpufreq.c b/drivers/cpufreq/tegra194-cpufreq.c
index 36dad5ea5947..c90b30469165 100644
--- a/drivers/cpufreq/tegra194-cpufreq.c
+++ b/drivers/cpufreq/tegra194-cpufreq.c
@@ -708,12 +708,10 @@ static int tegra194_cpufreq_probe(struct platform_device *pdev)
return err;
}
-static int tegra194_cpufreq_remove(struct platform_device *pdev)
+static void tegra194_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&tegra194_cpufreq_driver);
tegra194_cpufreq_free_resources();
-
- return 0;
}
static const struct of_device_id tegra194_cpufreq_of_match[] = {
@@ -730,7 +728,7 @@ static struct platform_driver tegra194_ccplex_driver = {
.of_match_table = tegra194_cpufreq_of_match,
},
.probe = tegra194_cpufreq_probe,
- .remove = tegra194_cpufreq_remove,
+ .remove_new = tegra194_cpufreq_remove,
};
module_platform_driver(tegra194_ccplex_driver);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 09/19] cpufreq: brcmstb-avs-cpufreq: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (6 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 08/19] cpufreq: tegra194: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 15:38 ` Florian Fainelli
2023-07-12 9:33 ` [PATCH 10/19] cpufreq: imx-cpufreq-dt: " Yangtao Li
` (11 subsequent siblings)
19 siblings, 1 reply; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Markus Mayer, Broadcom internal kernel review list,
Rafael J. Wysocki, Viresh Kumar, Florian Fainelli
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/cpufreq/brcmstb-avs-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
index ffea6402189d..1bdd513bcd19 100644
--- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
+++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
@@ -749,13 +749,11 @@ static int brcm_avs_cpufreq_probe(struct platform_device *pdev)
return ret;
}
-static int brcm_avs_cpufreq_remove(struct platform_device *pdev)
+static void brcm_avs_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&brcm_avs_driver);
brcm_avs_prepare_uninit(pdev);
-
- return 0;
}
static const struct of_device_id brcm_avs_cpufreq_match[] = {
@@ -770,7 +768,7 @@ static struct platform_driver brcm_avs_cpufreq_platdrv = {
.of_match_table = brcm_avs_cpufreq_match,
},
.probe = brcm_avs_cpufreq_probe,
- .remove = brcm_avs_cpufreq_remove,
+ .remove_new = brcm_avs_cpufreq_remove,
};
module_platform_driver(brcm_avs_cpufreq_platdrv);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 10/19] cpufreq: imx-cpufreq-dt: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (7 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 09/19] cpufreq: brcmstb-avs-cpufreq: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 11/19] cpufreq: davinci: " Yangtao Li
` (10 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar, 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/cpufreq/imx-cpufreq-dt.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/imx-cpufreq-dt.c b/drivers/cpufreq/imx-cpufreq-dt.c
index 535867a7dfdd..577bb9e2f112 100644
--- a/drivers/cpufreq/imx-cpufreq-dt.c
+++ b/drivers/cpufreq/imx-cpufreq-dt.c
@@ -172,20 +172,18 @@ static int imx_cpufreq_dt_probe(struct platform_device *pdev)
return 0;
}
-static int imx_cpufreq_dt_remove(struct platform_device *pdev)
+static void imx_cpufreq_dt_remove(struct platform_device *pdev)
{
platform_device_unregister(cpufreq_dt_pdev);
if (!of_machine_is_compatible("fsl,imx7ulp"))
dev_pm_opp_put_supported_hw(cpufreq_opp_token);
else
clk_bulk_put(ARRAY_SIZE(imx7ulp_clks), imx7ulp_clks);
-
- return 0;
}
static struct platform_driver imx_cpufreq_dt_driver = {
.probe = imx_cpufreq_dt_probe,
- .remove = imx_cpufreq_dt_remove,
+ .remove_new = imx_cpufreq_dt_remove,
.driver = {
.name = "imx-cpufreq-dt",
},
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 11/19] cpufreq: davinci: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (8 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 10/19] cpufreq: imx-cpufreq-dt: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 12/19] cpufreq: raspberrypi: " Yangtao Li
` (9 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar
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/cpufreq/davinci-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/davinci-cpufreq.c b/drivers/cpufreq/davinci-cpufreq.c
index ebb3a8102681..7d2754411d8c 100644
--- a/drivers/cpufreq/davinci-cpufreq.c
+++ b/drivers/cpufreq/davinci-cpufreq.c
@@ -131,7 +131,7 @@ static int __init davinci_cpufreq_probe(struct platform_device *pdev)
return cpufreq_register_driver(&davinci_driver);
}
-static int __exit davinci_cpufreq_remove(struct platform_device *pdev)
+static void __exit davinci_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&davinci_driver);
@@ -139,15 +139,13 @@ static int __exit davinci_cpufreq_remove(struct platform_device *pdev)
if (cpufreq.asyncclk)
clk_put(cpufreq.asyncclk);
-
- return 0;
}
static struct platform_driver davinci_cpufreq_driver = {
.driver = {
.name = "cpufreq-davinci",
},
- .remove = __exit_p(davinci_cpufreq_remove),
+ .remove_new = __exit_p(davinci_cpufreq_remove),
};
int __init davinci_cpufreq_init(void)
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 12/19] cpufreq: raspberrypi: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (9 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 11/19] cpufreq: davinci: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 15:38 ` Florian Fainelli
2023-07-12 9:33 ` [PATCH 13/19] cpufreq: pcc-cpufreq: " Yangtao Li
` (8 subsequent siblings)
19 siblings, 1 reply; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar, Florian Fainelli,
Broadcom internal kernel review list
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/cpufreq/raspberrypi-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/raspberrypi-cpufreq.c b/drivers/cpufreq/raspberrypi-cpufreq.c
index 2bc7d9734272..e0705cc9a57d 100644
--- a/drivers/cpufreq/raspberrypi-cpufreq.c
+++ b/drivers/cpufreq/raspberrypi-cpufreq.c
@@ -65,7 +65,7 @@ static int raspberrypi_cpufreq_probe(struct platform_device *pdev)
return ret;
}
-static int raspberrypi_cpufreq_remove(struct platform_device *pdev)
+static void raspberrypi_cpufreq_remove(struct platform_device *pdev)
{
struct device *cpu_dev;
@@ -74,8 +74,6 @@ static int raspberrypi_cpufreq_remove(struct platform_device *pdev)
dev_pm_opp_remove_all_dynamic(cpu_dev);
platform_device_unregister(cpufreq_dt);
-
- return 0;
}
/*
@@ -87,7 +85,7 @@ static struct platform_driver raspberrypi_cpufreq_driver = {
.name = "raspberrypi-cpufreq",
},
.probe = raspberrypi_cpufreq_probe,
- .remove = raspberrypi_cpufreq_remove,
+ .remove_new = raspberrypi_cpufreq_remove,
};
module_platform_driver(raspberrypi_cpufreq_driver);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 13/19] cpufreq: pcc-cpufreq: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (10 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 12/19] cpufreq: raspberrypi: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-14 18:59 ` Rafael J. Wysocki
2023-07-12 9:33 ` [PATCH 14/19] cpufreq: kirkwood: " Yangtao Li
` (7 subsequent siblings)
19 siblings, 1 reply; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar
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/cpufreq/pcc-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c
index 73efbcf5513b..84fe37def0f1 100644
--- a/drivers/cpufreq/pcc-cpufreq.c
+++ b/drivers/cpufreq/pcc-cpufreq.c
@@ -608,22 +608,20 @@ static int __init pcc_cpufreq_probe(struct platform_device *pdev)
return ret;
}
-static int pcc_cpufreq_remove(struct platform_device *pdev)
+static void pcc_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&pcc_cpufreq_driver);
pcc_clear_mapping();
free_percpu(pcc_cpu_info);
-
- return 0;
}
static struct platform_driver pcc_cpufreq_platdrv = {
.driver = {
.name = "pcc-cpufreq",
},
- .remove = pcc_cpufreq_remove,
+ .remove_new = pcc_cpufreq_remove,
};
static int __init pcc_cpufreq_init(void)
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 14/19] cpufreq: kirkwood: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (11 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 13/19] cpufreq: pcc-cpufreq: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 15/19] cpufreq: qcom-nvmem: " Yangtao Li
` (6 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar
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/cpufreq/kirkwood-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c
index 95588101efbd..fd20b986d1f2 100644
--- a/drivers/cpufreq/kirkwood-cpufreq.c
+++ b/drivers/cpufreq/kirkwood-cpufreq.c
@@ -178,20 +178,18 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev)
return err;
}
-static int kirkwood_cpufreq_remove(struct platform_device *pdev)
+static void kirkwood_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&kirkwood_cpufreq_driver);
clk_disable_unprepare(priv.powersave_clk);
clk_disable_unprepare(priv.ddr_clk);
clk_disable_unprepare(priv.cpu_clk);
-
- return 0;
}
static struct platform_driver kirkwood_cpufreq_platform_driver = {
.probe = kirkwood_cpufreq_probe,
- .remove = kirkwood_cpufreq_remove,
+ .remove_new = kirkwood_cpufreq_remove,
.driver = {
.name = "kirkwood-cpufreq",
},
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 15/19] cpufreq: qcom-nvmem: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (12 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 14/19] cpufreq: kirkwood: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 16/19] cpufreq: tegra186: " Yangtao Li
` (5 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Ilia Lin,
Rafael J. Wysocki, Viresh Kumar
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/cpufreq/qcom-cpufreq-nvmem.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/qcom-cpufreq-nvmem.c b/drivers/cpufreq/qcom-cpufreq-nvmem.c
index a88b6fe5db50..3db58d5957b9 100644
--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
@@ -334,7 +334,7 @@ static int qcom_cpufreq_probe(struct platform_device *pdev)
return ret;
}
-static int qcom_cpufreq_remove(struct platform_device *pdev)
+static void qcom_cpufreq_remove(struct platform_device *pdev)
{
struct qcom_cpufreq_drv *drv = platform_get_drvdata(pdev);
unsigned int cpu;
@@ -346,13 +346,11 @@ static int qcom_cpufreq_remove(struct platform_device *pdev)
kfree(drv->opp_tokens);
kfree(drv);
-
- return 0;
}
static struct platform_driver qcom_cpufreq_driver = {
.probe = qcom_cpufreq_probe,
- .remove = qcom_cpufreq_remove,
+ .remove_new = qcom_cpufreq_remove,
.driver = {
.name = "qcom-cpufreq-nvmem",
},
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 16/19] cpufreq: tegra186: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (13 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 15/19] cpufreq: qcom-nvmem: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 17/19] cpufreq: acpi: " Yangtao Li
` (4 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar, 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/cpufreq/tegra186-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/tegra186-cpufreq.c b/drivers/cpufreq/tegra186-cpufreq.c
index f98f53bf1011..7b8fcfa55038 100644
--- a/drivers/cpufreq/tegra186-cpufreq.c
+++ b/drivers/cpufreq/tegra186-cpufreq.c
@@ -259,11 +259,9 @@ static int tegra186_cpufreq_probe(struct platform_device *pdev)
return err;
}
-static int tegra186_cpufreq_remove(struct platform_device *pdev)
+static void tegra186_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&tegra186_cpufreq_driver);
-
- return 0;
}
static const struct of_device_id tegra186_cpufreq_of_match[] = {
@@ -278,7 +276,7 @@ static struct platform_driver tegra186_cpufreq_platform_driver = {
.of_match_table = tegra186_cpufreq_of_match,
},
.probe = tegra186_cpufreq_probe,
- .remove = tegra186_cpufreq_remove,
+ .remove_new = tegra186_cpufreq_remove,
};
module_platform_driver(tegra186_cpufreq_platform_driver);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 17/19] cpufreq: acpi: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (14 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 16/19] cpufreq: tegra186: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-14 18:57 ` Rafael J. Wysocki
2023-07-12 9:33 ` [PATCH 18/19] cpufreq: qoriq: " Yangtao Li
` (3 subsequent siblings)
19 siblings, 1 reply; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar
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/cpufreq/acpi-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index b2f05d27167e..37f1cdf46d29 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -1011,22 +1011,20 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev)
return ret;
}
-static int acpi_cpufreq_remove(struct platform_device *pdev)
+static void acpi_cpufreq_remove(struct platform_device *pdev)
{
pr_debug("%s\n", __func__);
cpufreq_unregister_driver(&acpi_cpufreq_driver);
free_acpi_perf_data();
-
- return 0;
}
static struct platform_driver acpi_cpufreq_platdrv = {
.driver = {
.name = "acpi-cpufreq",
},
- .remove = acpi_cpufreq_remove,
+ .remove_new = acpi_cpufreq_remove,
};
static int __init acpi_cpufreq_init(void)
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 18/19] cpufreq: qoriq: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (15 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 17/19] cpufreq: acpi: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 9:33 ` [PATCH 19/19] cpufreq: omap: " Yangtao Li
` (2 subsequent siblings)
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Rafael J. Wysocki, Viresh Kumar
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/cpufreq/qoriq-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c
index 573b417e1483..0aecaecbb0e6 100644
--- a/drivers/cpufreq/qoriq-cpufreq.c
+++ b/drivers/cpufreq/qoriq-cpufreq.c
@@ -288,11 +288,9 @@ static int qoriq_cpufreq_probe(struct platform_device *pdev)
return 0;
}
-static int qoriq_cpufreq_remove(struct platform_device *pdev)
+static void qoriq_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&qoriq_cpufreq_driver);
-
- return 0;
}
static struct platform_driver qoriq_cpufreq_platform_driver = {
@@ -300,7 +298,7 @@ static struct platform_driver qoriq_cpufreq_platform_driver = {
.name = "qoriq-cpufreq",
},
.probe = qoriq_cpufreq_probe,
- .remove = qoriq_cpufreq_remove,
+ .remove_new = qoriq_cpufreq_remove,
};
module_platform_driver(qoriq_cpufreq_platform_driver);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 19/19] cpufreq: omap: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (16 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 18/19] cpufreq: qoriq: " Yangtao Li
@ 2023-07-12 9:33 ` Yangtao Li
2023-07-12 16:05 ` [PATCH 01/19] cpufreq: sun50i: " Jernej Škrabec
2023-07-20 10:32 ` Viresh Kumar
19 siblings, 0 replies; 27+ messages in thread
From: Yangtao Li @ 2023-07-12 9:33 UTC (permalink / raw)
To: Kevin Hilman, Rafael J. Wysocki, Viresh Kumar
Cc: Yangtao Li, Uwe Kleine-König, linux-omap, 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/cpufreq/omap-cpufreq.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index 81649a1969b6..895690856665 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -182,11 +182,9 @@ static int omap_cpufreq_probe(struct platform_device *pdev)
return cpufreq_register_driver(&omap_driver);
}
-static int omap_cpufreq_remove(struct platform_device *pdev)
+static void omap_cpufreq_remove(struct platform_device *pdev)
{
cpufreq_unregister_driver(&omap_driver);
-
- return 0;
}
static struct platform_driver omap_cpufreq_platdrv = {
@@ -194,7 +192,7 @@ static struct platform_driver omap_cpufreq_platdrv = {
.name = "omap-cpufreq",
},
.probe = omap_cpufreq_probe,
- .remove = omap_cpufreq_remove,
+ .remove_new = omap_cpufreq_remove,
};
module_platform_driver(omap_cpufreq_platdrv);
--
2.39.0
^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 09/19] cpufreq: brcmstb-avs-cpufreq: Convert to platform remove callback returning void
2023-07-12 9:33 ` [PATCH 09/19] cpufreq: brcmstb-avs-cpufreq: " Yangtao Li
@ 2023-07-12 15:38 ` Florian Fainelli
0 siblings, 0 replies; 27+ messages in thread
From: Florian Fainelli @ 2023-07-12 15:38 UTC (permalink / raw)
To: Yangtao Li, Markus Mayer, Broadcom internal kernel review list,
Rafael J. Wysocki, Viresh Kumar
Cc: Uwe Kleine-König, linux-pm, linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 798 bytes --]
On 7/12/2023 11:33 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] 27+ messages in thread
* Re: [PATCH 12/19] cpufreq: raspberrypi: Convert to platform remove callback returning void
2023-07-12 9:33 ` [PATCH 12/19] cpufreq: raspberrypi: " Yangtao Li
@ 2023-07-12 15:38 ` Florian Fainelli
0 siblings, 0 replies; 27+ messages in thread
From: Florian Fainelli @ 2023-07-12 15:38 UTC (permalink / raw)
To: Yangtao Li, Rafael J. Wysocki, Viresh Kumar,
Broadcom internal kernel review list
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 11:33 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] 27+ messages in thread
* Re: [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (17 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 19/19] cpufreq: omap: " Yangtao Li
@ 2023-07-12 16:05 ` Jernej Škrabec
2023-07-20 10:32 ` Viresh Kumar
19 siblings, 0 replies; 27+ messages in thread
From: Jernej Škrabec @ 2023-07-12 16:05 UTC (permalink / raw)
To: Yangtao Li, Rafael J. Wysocki, Viresh Kumar, Chen-Yu Tsai,
Samuel Holland, Yangtao Li
Cc: Yangtao Li, Uwe Kleine-König, linux-pm, linux-arm-kernel,
linux-sunxi, linux-kernel
Dne sreda, 12. julij 2023 ob 11:33:04 CEST je Yangtao Li napisal(a):
> 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: Jernej Škrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> ---
> drivers/cpufreq/sun50i-cpufreq-nvmem.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c
> b/drivers/cpufreq/sun50i-cpufreq-nvmem.c index 4321d7bbe769..32a9c88f8ff6
> 100644
> --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c
> +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
> @@ -137,7 +137,7 @@ static int sun50i_cpufreq_nvmem_probe(struct
> platform_device *pdev) return ret;
> }
>
> -static int sun50i_cpufreq_nvmem_remove(struct platform_device *pdev)
> +static void sun50i_cpufreq_nvmem_remove(struct platform_device *pdev)
> {
> int *opp_tokens = platform_get_drvdata(pdev);
> unsigned int cpu;
> @@ -148,13 +148,11 @@ static int sun50i_cpufreq_nvmem_remove(struct
> platform_device *pdev) dev_pm_opp_put_prop_name(opp_tokens[cpu]);
>
> kfree(opp_tokens);
> -
> - return 0;
> }
>
> static struct platform_driver sun50i_cpufreq_driver = {
> .probe = sun50i_cpufreq_nvmem_probe,
> - .remove = sun50i_cpufreq_nvmem_remove,
> + .remove_new = sun50i_cpufreq_nvmem_remove,
> .driver = {
> .name = "sun50i-cpufreq-nvmem",
> },
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 04/19] cpufreq: vexpress: Convert to platform remove callback returning void
2023-07-12 9:33 ` [PATCH 04/19] cpufreq: vexpress: " Yangtao Li
@ 2023-07-13 13:04 ` Sudeep Holla
0 siblings, 0 replies; 27+ messages in thread
From: Sudeep Holla @ 2023-07-13 13:04 UTC (permalink / raw)
To: Yangtao Li
Cc: Viresh Kumar, Sudeep Holla, Rafael J. Wysocki, Liviu Dudau,
Lorenzo Pieralisi, Uwe Kleine-König, linux-pm, linux-kernel,
linux-arm-kernel
On Wed, Jul 12, 2023 at 05:33:07PM +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>
I assume either Viresh will pick this or you are planning to group all
similar changes and get it merged together. Either way,
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 07/19] cpufreq: scpi: Convert to platform remove callback returning void
2023-07-12 9:33 ` [PATCH 07/19] cpufreq: scpi: " Yangtao Li
@ 2023-07-13 13:06 ` Sudeep Holla
0 siblings, 0 replies; 27+ messages in thread
From: Sudeep Holla @ 2023-07-13 13:06 UTC (permalink / raw)
To: Yangtao Li
Cc: Cristian Marussi, Sudeep Holla, Rafael J. Wysocki, Viresh Kumar,
Uwe Kleine-König, linux-arm-kernel, linux-pm, linux-kernel
On Wed, Jul 12, 2023 at 05:33:10PM +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.
Again I assume either Viresh will pick this or you are planning to group all
similar changes and get it merged together. Either way,
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 17/19] cpufreq: acpi: Convert to platform remove callback returning void
2023-07-12 9:33 ` [PATCH 17/19] cpufreq: acpi: " Yangtao Li
@ 2023-07-14 18:57 ` Rafael J. Wysocki
0 siblings, 0 replies; 27+ messages in thread
From: Rafael J. Wysocki @ 2023-07-14 18:57 UTC (permalink / raw)
To: Yangtao Li
Cc: Rafael J. Wysocki, Viresh Kumar, Uwe Kleine-König, linux-pm,
linux-kernel
On Wed, Jul 12, 2023 at 11:34 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/cpufreq/acpi-cpufreq.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
> index b2f05d27167e..37f1cdf46d29 100644
> --- a/drivers/cpufreq/acpi-cpufreq.c
> +++ b/drivers/cpufreq/acpi-cpufreq.c
> @@ -1011,22 +1011,20 @@ static int __init acpi_cpufreq_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int acpi_cpufreq_remove(struct platform_device *pdev)
> +static void acpi_cpufreq_remove(struct platform_device *pdev)
> {
> pr_debug("%s\n", __func__);
>
> cpufreq_unregister_driver(&acpi_cpufreq_driver);
>
> free_acpi_perf_data();
> -
> - return 0;
> }
>
> static struct platform_driver acpi_cpufreq_platdrv = {
> .driver = {
> .name = "acpi-cpufreq",
> },
> - .remove = acpi_cpufreq_remove,
> + .remove_new = acpi_cpufreq_remove,
> };
>
> static int __init acpi_cpufreq_init(void)
> --
> 2.39.0
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 13/19] cpufreq: pcc-cpufreq: Convert to platform remove callback returning void
2023-07-12 9:33 ` [PATCH 13/19] cpufreq: pcc-cpufreq: " Yangtao Li
@ 2023-07-14 18:59 ` Rafael J. Wysocki
0 siblings, 0 replies; 27+ messages in thread
From: Rafael J. Wysocki @ 2023-07-14 18:59 UTC (permalink / raw)
To: Yangtao Li
Cc: Rafael J. Wysocki, Viresh Kumar, Uwe Kleine-König, linux-pm,
linux-kernel
On Wed, Jul 12, 2023 at 11:34 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 ths up.
Thanks!
> ---
> drivers/cpufreq/pcc-cpufreq.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cpufreq/pcc-cpufreq.c b/drivers/cpufreq/pcc-cpufreq.c
> index 73efbcf5513b..84fe37def0f1 100644
> --- a/drivers/cpufreq/pcc-cpufreq.c
> +++ b/drivers/cpufreq/pcc-cpufreq.c
> @@ -608,22 +608,20 @@ static int __init pcc_cpufreq_probe(struct platform_device *pdev)
> return ret;
> }
>
> -static int pcc_cpufreq_remove(struct platform_device *pdev)
> +static void pcc_cpufreq_remove(struct platform_device *pdev)
> {
> cpufreq_unregister_driver(&pcc_cpufreq_driver);
>
> pcc_clear_mapping();
>
> free_percpu(pcc_cpu_info);
> -
> - return 0;
> }
>
> static struct platform_driver pcc_cpufreq_platdrv = {
> .driver = {
> .name = "pcc-cpufreq",
> },
> - .remove = pcc_cpufreq_remove,
> + .remove_new = pcc_cpufreq_remove,
> };
>
> static int __init pcc_cpufreq_init(void)
> --
> 2.39.0
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
` (18 preceding siblings ...)
2023-07-12 16:05 ` [PATCH 01/19] cpufreq: sun50i: " Jernej Škrabec
@ 2023-07-20 10:32 ` Viresh Kumar
19 siblings, 0 replies; 27+ messages in thread
From: Viresh Kumar @ 2023-07-20 10:32 UTC (permalink / raw)
To: Yangtao Li
Cc: Yangtao Li, Rafael J. Wysocki, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Uwe Kleine-König, linux-pm, linux-arm-kernel,
linux-sunxi, linux-kernel
On 12-07-23, 17:33, 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/cpufreq/sun50i-cpufreq-nvmem.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Applied all the patches. Thanks.
--
viresh
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2023-07-20 10:33 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-12 9:33 [PATCH 01/19] cpufreq: sun50i: Convert to platform remove callback returning void Yangtao Li
2023-07-12 9:33 ` [PATCH 02/19] cpufreq: dt: " Yangtao Li
2023-07-12 9:33 ` [PATCH 03/19] cpufreq: qcom-cpufreq-hw: " Yangtao Li
2023-07-12 9:33 ` [PATCH 04/19] cpufreq: vexpress: " Yangtao Li
2023-07-13 13:04 ` Sudeep Holla
2023-07-12 9:33 ` [PATCH 05/19] cpufreq: imx6q: " Yangtao Li
2023-07-12 9:33 ` [PATCH 06/19] cpufreq: mediatek-hw: " Yangtao Li
2023-07-12 9:33 ` [PATCH 07/19] cpufreq: scpi: " Yangtao Li
2023-07-13 13:06 ` Sudeep Holla
2023-07-12 9:33 ` [PATCH 08/19] cpufreq: tegra194: " Yangtao Li
2023-07-12 9:33 ` [PATCH 09/19] cpufreq: brcmstb-avs-cpufreq: " Yangtao Li
2023-07-12 15:38 ` Florian Fainelli
2023-07-12 9:33 ` [PATCH 10/19] cpufreq: imx-cpufreq-dt: " Yangtao Li
2023-07-12 9:33 ` [PATCH 11/19] cpufreq: davinci: " Yangtao Li
2023-07-12 9:33 ` [PATCH 12/19] cpufreq: raspberrypi: " Yangtao Li
2023-07-12 15:38 ` Florian Fainelli
2023-07-12 9:33 ` [PATCH 13/19] cpufreq: pcc-cpufreq: " Yangtao Li
2023-07-14 18:59 ` Rafael J. Wysocki
2023-07-12 9:33 ` [PATCH 14/19] cpufreq: kirkwood: " Yangtao Li
2023-07-12 9:33 ` [PATCH 15/19] cpufreq: qcom-nvmem: " Yangtao Li
2023-07-12 9:33 ` [PATCH 16/19] cpufreq: tegra186: " Yangtao Li
2023-07-12 9:33 ` [PATCH 17/19] cpufreq: acpi: " Yangtao Li
2023-07-14 18:57 ` Rafael J. Wysocki
2023-07-12 9:33 ` [PATCH 18/19] cpufreq: qoriq: " Yangtao Li
2023-07-12 9:33 ` [PATCH 19/19] cpufreq: omap: " Yangtao Li
2023-07-12 16:05 ` [PATCH 01/19] cpufreq: sun50i: " Jernej Škrabec
2023-07-20 10:32 ` Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox