* [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 04/19] cpufreq: vexpress: " Yangtao Li
` (8 more replies)
0 siblings, 9 replies; 14+ 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
_______________________________________________
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] 14+ 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 ` Yangtao Li
2023-07-13 13:04 ` Sudeep Holla
2023-07-12 9:33 ` [PATCH 05/19] cpufreq: imx6q: " Yangtao Li
` (7 subsequent siblings)
8 siblings, 1 reply; 14+ 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
_______________________________________________
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] 14+ 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
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
` (6 subsequent siblings)
8 siblings, 0 replies; 14+ 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
_______________________________________________
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] 14+ 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
2023-07-12 9:33 ` [PATCH 04/19] cpufreq: vexpress: " Yangtao Li
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
` (5 subsequent siblings)
8 siblings, 0 replies; 14+ 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
_______________________________________________
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] 14+ 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
` (2 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 09/19] cpufreq: brcmstb-avs-cpufreq: " Yangtao Li
` (4 subsequent siblings)
8 siblings, 1 reply; 14+ 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
_______________________________________________
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] 14+ 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
` (3 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 07/19] cpufreq: scpi: " 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
` (3 subsequent siblings)
8 siblings, 1 reply; 14+ 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
_______________________________________________
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] 14+ 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
` (4 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 12/19] cpufreq: raspberrypi: " Yangtao Li
` (2 subsequent siblings)
8 siblings, 0 replies; 14+ 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
_______________________________________________
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] 14+ 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
` (5 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 15:38 ` Florian Fainelli
2023-07-12 16:05 ` [PATCH 01/19] cpufreq: sun50i: " Jernej Škrabec
2023-07-20 10:32 ` Viresh Kumar
8 siblings, 1 reply; 14+ 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
_______________________________________________
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] 14+ 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; 14+ 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.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 #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] 14+ 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; 14+ 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.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 #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] 14+ 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
` (6 preceding siblings ...)
2023-07-12 9:33 ` [PATCH 12/19] cpufreq: raspberrypi: " Yangtao Li
@ 2023-07-12 16:05 ` Jernej Škrabec
2023-07-20 10:32 ` Viresh Kumar
8 siblings, 0 replies; 14+ 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",
> },
_______________________________________________
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] 14+ 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; 14+ 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
_______________________________________________
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] 14+ 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; 14+ 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
_______________________________________________
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] 14+ 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
` (7 preceding siblings ...)
2023-07-12 16:05 ` [PATCH 01/19] cpufreq: sun50i: " Jernej Škrabec
@ 2023-07-20 10:32 ` Viresh Kumar
8 siblings, 0 replies; 14+ 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
_______________________________________________
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] 14+ messages in thread
end of thread, other threads:[~2023-07-20 10:33 UTC | newest]
Thread overview: 14+ 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 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 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 12/19] cpufreq: raspberrypi: " Yangtao Li
2023-07-12 15:38 ` Florian Fainelli
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