* [PATCH 0/8] regulator: Convert to platform remove callback returning void
@ 2023-12-05 12:26 Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 1/8] regulator: arizona-ldo1: " Uwe Kleine-König
` (8 more replies)
0 siblings, 9 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-12-05 12:26 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: patches, linux-kernel, Marek Vasut, linux-renesas-soc,
Maxime Coquelin, Alexandre Torgue, linux-stm32, linux-arm-kernel,
Kunihiko Hayashi, Masami Hiramatsu, kernel
Hello,
this series converts all drivers below drivers/regulator to struct
platform_driver::remove_new(). See commit 5c5a7680e67b ("platform:
Provide a remove callback that returns no value") for an extended
explanation and the eventual goal.
All conversations are trivial, because all .remove() callbacks returned
zero unconditionally.
There are no interdependencies between these patches, so they could be
picked up individually. However I'd expect them to go in all together
via Mark's regulator tree.
Best regards
Uwe
Uwe Kleine-König (8):
regulator: arizona-ldo1: Convert to platform remove callback returning
void
regulator: bd9571mwv: Convert to platform remove callback returning
void
regulator: db8500-prcmu: Convert to platform remove callback returning
void
regulator: stm32-vrefbuf: Convert to platform remove callback
returning void
regulator: uniphier: Convert to platform remove callback returning
void
regulator: userspace-consumer: Convert to platform remove callback
returning void
regulator: virtual: Convert to platform remove callback returning void
regulator: wm8350: Convert to platform remove callback returning void
drivers/regulator/arizona-ldo1.c | 8 +++-----
drivers/regulator/bd9571mwv-regulator.c | 5 ++---
drivers/regulator/db8500-prcmu.c | 6 ++----
drivers/regulator/stm32-vrefbuf.c | 6 ++----
drivers/regulator/uniphier-regulator.c | 6 ++----
drivers/regulator/userspace-consumer.c | 6 ++----
drivers/regulator/virtual.c | 6 ++----
drivers/regulator/wm8350-regulator.c | 6 ++----
8 files changed, 17 insertions(+), 32 deletions(-)
base-commit: 0f5f12ac05f36f117e793656c3f560625e927f1b
--
2.42.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/8] regulator: arizona-ldo1: Convert to platform remove callback returning void
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-12-05 12:26 ` Uwe Kleine-König
2023-12-05 13:06 ` Charles Keepax
2023-12-05 12:26 ` [PATCH 2/8] regulator: bd9571mwv: " Uwe Kleine-König
` (7 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2023-12-05 12:26 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: patches, linux-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/regulator/arizona-ldo1.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/regulator/arizona-ldo1.c b/drivers/regulator/arizona-ldo1.c
index b465c0010665..4b54068d4f59 100644
--- a/drivers/regulator/arizona-ldo1.c
+++ b/drivers/regulator/arizona-ldo1.c
@@ -339,14 +339,12 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
return ret;
}
-static int arizona_ldo1_remove(struct platform_device *pdev)
+static void arizona_ldo1_remove(struct platform_device *pdev)
{
struct arizona_ldo1 *ldo1 = platform_get_drvdata(pdev);
if (ldo1->ena_gpiod)
gpiod_put(ldo1->ena_gpiod);
-
- return 0;
}
static int madera_ldo1_probe(struct platform_device *pdev)
@@ -377,7 +375,7 @@ static int madera_ldo1_probe(struct platform_device *pdev)
static struct platform_driver arizona_ldo1_driver = {
.probe = arizona_ldo1_probe,
- .remove = arizona_ldo1_remove,
+ .remove_new = arizona_ldo1_remove,
.driver = {
.name = "arizona-ldo1",
.probe_type = PROBE_FORCE_SYNCHRONOUS,
@@ -386,7 +384,7 @@ static struct platform_driver arizona_ldo1_driver = {
static struct platform_driver madera_ldo1_driver = {
.probe = madera_ldo1_probe,
- .remove = arizona_ldo1_remove,
+ .remove_new = arizona_ldo1_remove,
.driver = {
.name = "madera-ldo1",
.probe_type = PROBE_FORCE_SYNCHRONOUS,
--
2.42.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/8] regulator: bd9571mwv: Convert to platform remove callback returning void
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 1/8] regulator: arizona-ldo1: " Uwe Kleine-König
@ 2023-12-05 12:26 ` Uwe Kleine-König
2023-12-05 14:16 ` Geert Uytterhoeven
2023-12-05 12:26 ` [PATCH 3/8] regulator: db8500-prcmu: " Uwe Kleine-König
` (6 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2023-12-05 12:26 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Marek Vasut, linux-kernel, linux-renesas-soc, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/regulator/bd9571mwv-regulator.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c
index d469481d8442..c7ceba56e7dc 100644
--- a/drivers/regulator/bd9571mwv-regulator.c
+++ b/drivers/regulator/bd9571mwv-regulator.c
@@ -260,10 +260,9 @@ static const struct dev_pm_ops bd9571mwv_pm = {
SET_SYSTEM_SLEEP_PM_OPS(bd9571mwv_suspend, bd9571mwv_resume)
};
-static int bd9571mwv_regulator_remove(struct platform_device *pdev)
+static void bd9571mwv_regulator_remove(struct platform_device *pdev)
{
device_remove_file(&pdev->dev, &dev_attr_backup_mode);
- return 0;
}
#define DEV_PM_OPS &bd9571mwv_pm
#else
@@ -357,7 +356,7 @@ static struct platform_driver bd9571mwv_regulator_driver = {
.pm = DEV_PM_OPS,
},
.probe = bd9571mwv_regulator_probe,
- .remove = bd9571mwv_regulator_remove,
+ .remove_new = bd9571mwv_regulator_remove,
.id_table = bd9571mwv_regulator_id_table,
};
module_platform_driver(bd9571mwv_regulator_driver);
--
2.42.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 3/8] regulator: db8500-prcmu: Convert to platform remove callback returning void
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 1/8] regulator: arizona-ldo1: " Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 2/8] regulator: bd9571mwv: " Uwe Kleine-König
@ 2023-12-05 12:26 ` Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 4/8] regulator: stm32-vrefbuf: " Uwe Kleine-König
` (5 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-12-05 12:26 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/regulator/db8500-prcmu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c
index 34c5e485d0af..1e2d54da1b9a 100644
--- a/drivers/regulator/db8500-prcmu.c
+++ b/drivers/regulator/db8500-prcmu.c
@@ -469,11 +469,9 @@ static int db8500_regulator_probe(struct platform_device *pdev)
return 0;
}
-static int db8500_regulator_remove(struct platform_device *pdev)
+static void db8500_regulator_remove(struct platform_device *pdev)
{
ux500_regulator_debug_exit();
-
- return 0;
}
static struct platform_driver db8500_regulator_driver = {
@@ -482,7 +480,7 @@ static struct platform_driver db8500_regulator_driver = {
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
},
.probe = db8500_regulator_probe,
- .remove = db8500_regulator_remove,
+ .remove_new = db8500_regulator_remove,
};
static int __init db8500_regulator_init(void)
--
2.42.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 4/8] regulator: stm32-vrefbuf: Convert to platform remove callback returning void
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
` (2 preceding siblings ...)
2023-12-05 12:26 ` [PATCH 3/8] regulator: db8500-prcmu: " Uwe Kleine-König
@ 2023-12-05 12:26 ` Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 5/8] regulator: uniphier: " Uwe Kleine-König
` (4 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-12-05 12:26 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Maxime Coquelin, Alexandre Torgue, linux-kernel, linux-stm32,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/regulator/stm32-vrefbuf.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/stm32-vrefbuf.c b/drivers/regulator/stm32-vrefbuf.c
index 717144cbe0f9..40855105dd33 100644
--- a/drivers/regulator/stm32-vrefbuf.c
+++ b/drivers/regulator/stm32-vrefbuf.c
@@ -233,7 +233,7 @@ static int stm32_vrefbuf_probe(struct platform_device *pdev)
return ret;
}
-static int stm32_vrefbuf_remove(struct platform_device *pdev)
+static void stm32_vrefbuf_remove(struct platform_device *pdev)
{
struct regulator_dev *rdev = platform_get_drvdata(pdev);
struct stm32_vrefbuf *priv = rdev_get_drvdata(rdev);
@@ -244,8 +244,6 @@ static int stm32_vrefbuf_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
pm_runtime_set_suspended(&pdev->dev);
pm_runtime_put_noidle(&pdev->dev);
-
- return 0;
};
static int __maybe_unused stm32_vrefbuf_runtime_suspend(struct device *dev)
@@ -282,7 +280,7 @@ MODULE_DEVICE_TABLE(of, stm32_vrefbuf_of_match);
static struct platform_driver stm32_vrefbuf_driver = {
.probe = stm32_vrefbuf_probe,
- .remove = stm32_vrefbuf_remove,
+ .remove_new = stm32_vrefbuf_remove,
.driver = {
.name = "stm32-vrefbuf",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
--
2.42.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 5/8] regulator: uniphier: Convert to platform remove callback returning void
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
` (3 preceding siblings ...)
2023-12-05 12:26 ` [PATCH 4/8] regulator: stm32-vrefbuf: " Uwe Kleine-König
@ 2023-12-05 12:26 ` Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 6/8] regulator: userspace-consumer: " Uwe Kleine-König
` (3 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-12-05 12:26 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown
Cc: Kunihiko Hayashi, Masami Hiramatsu, linux-kernel,
linux-arm-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/regulator/uniphier-regulator.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/uniphier-regulator.c b/drivers/regulator/uniphier-regulator.c
index 1d8304b88bd6..5f868042392f 100644
--- a/drivers/regulator/uniphier-regulator.c
+++ b/drivers/regulator/uniphier-regulator.c
@@ -115,7 +115,7 @@ static int uniphier_regulator_probe(struct platform_device *pdev)
return ret;
}
-static int uniphier_regulator_remove(struct platform_device *pdev)
+static void uniphier_regulator_remove(struct platform_device *pdev)
{
struct uniphier_regulator_priv *priv = platform_get_drvdata(pdev);
int i;
@@ -124,8 +124,6 @@ static int uniphier_regulator_remove(struct platform_device *pdev)
reset_control_assert(priv->rst[i]);
clk_bulk_disable_unprepare(priv->data->nclks, priv->clk);
-
- return 0;
}
/* USB3 controller data */
@@ -209,7 +207,7 @@ MODULE_DEVICE_TABLE(of, uniphier_regulator_match);
static struct platform_driver uniphier_regulator_driver = {
.probe = uniphier_regulator_probe,
- .remove = uniphier_regulator_remove,
+ .remove_new = uniphier_regulator_remove,
.driver = {
.name = "uniphier-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
--
2.42.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 6/8] regulator: userspace-consumer: Convert to platform remove callback returning void
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
` (4 preceding siblings ...)
2023-12-05 12:26 ` [PATCH 5/8] regulator: uniphier: " Uwe Kleine-König
@ 2023-12-05 12:26 ` Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 7/8] regulator: virtual: " Uwe Kleine-König
` (2 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-12-05 12:26 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/regulator/userspace-consumer.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/userspace-consumer.c b/drivers/regulator/userspace-consumer.c
index 97f075ed68c9..53d1b9d6f69c 100644
--- a/drivers/regulator/userspace-consumer.c
+++ b/drivers/regulator/userspace-consumer.c
@@ -194,7 +194,7 @@ static int regulator_userspace_consumer_probe(struct platform_device *pdev)
return ret;
}
-static int regulator_userspace_consumer_remove(struct platform_device *pdev)
+static void regulator_userspace_consumer_remove(struct platform_device *pdev)
{
struct userspace_consumer_data *data = platform_get_drvdata(pdev);
@@ -202,8 +202,6 @@ static int regulator_userspace_consumer_remove(struct platform_device *pdev)
if (data->enabled && !data->no_autoswitch)
regulator_bulk_disable(data->num_supplies, data->supplies);
-
- return 0;
}
static const struct of_device_id regulator_userspace_consumer_of_match[] = {
@@ -213,7 +211,7 @@ static const struct of_device_id regulator_userspace_consumer_of_match[] = {
static struct platform_driver regulator_userspace_consumer_driver = {
.probe = regulator_userspace_consumer_probe,
- .remove = regulator_userspace_consumer_remove,
+ .remove_new = regulator_userspace_consumer_remove,
.driver = {
.name = "reg-userspace-consumer",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
--
2.42.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 7/8] regulator: virtual: Convert to platform remove callback returning void
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
` (5 preceding siblings ...)
2023-12-05 12:26 ` [PATCH 6/8] regulator: userspace-consumer: " Uwe Kleine-König
@ 2023-12-05 12:26 ` Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 8/8] regulator: wm8350: " Uwe Kleine-König
2023-12-12 15:46 ` [PATCH 0/8] regulator: " Mark Brown
8 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-12-05 12:26 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/regulator/virtual.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c
index d5a160efdae6..0a0ee186c6af 100644
--- a/drivers/regulator/virtual.c
+++ b/drivers/regulator/virtual.c
@@ -345,7 +345,7 @@ static int regulator_virtual_probe(struct platform_device *pdev)
return 0;
}
-static int regulator_virtual_remove(struct platform_device *pdev)
+static void regulator_virtual_remove(struct platform_device *pdev)
{
struct virtual_consumer_data *drvdata = platform_get_drvdata(pdev);
@@ -353,13 +353,11 @@ static int regulator_virtual_remove(struct platform_device *pdev)
if (drvdata->enabled)
regulator_disable(drvdata->regulator);
-
- return 0;
}
static struct platform_driver regulator_virtual_consumer_driver = {
.probe = regulator_virtual_probe,
- .remove = regulator_virtual_remove,
+ .remove_new = regulator_virtual_remove,
.driver = {
.name = "reg-virt-consumer",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
--
2.42.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 8/8] regulator: wm8350: Convert to platform remove callback returning void
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
` (6 preceding siblings ...)
2023-12-05 12:26 ` [PATCH 7/8] regulator: virtual: " Uwe Kleine-König
@ 2023-12-05 12:26 ` Uwe Kleine-König
2023-12-05 13:06 ` Charles Keepax
2023-12-12 15:46 ` [PATCH 0/8] regulator: " Mark Brown
8 siblings, 1 reply; 13+ messages in thread
From: Uwe Kleine-König @ 2023-12-05 12:26 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown; +Cc: patches, linux-kernel, kernel
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/regulator/wm8350-regulator.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c
index 1445bafcab40..9939a5d2cbec 100644
--- a/drivers/regulator/wm8350-regulator.c
+++ b/drivers/regulator/wm8350-regulator.c
@@ -1158,14 +1158,12 @@ static int wm8350_regulator_probe(struct platform_device *pdev)
return 0;
}
-static int wm8350_regulator_remove(struct platform_device *pdev)
+static void wm8350_regulator_remove(struct platform_device *pdev)
{
struct regulator_dev *rdev = platform_get_drvdata(pdev);
struct wm8350 *wm8350 = rdev_get_drvdata(rdev);
wm8350_free_irq(wm8350, wm8350_reg[pdev->id].irq, rdev);
-
- return 0;
}
int wm8350_register_regulator(struct wm8350 *wm8350, int reg,
@@ -1306,7 +1304,7 @@ EXPORT_SYMBOL_GPL(wm8350_register_led);
static struct platform_driver wm8350_regulator_driver = {
.probe = wm8350_regulator_probe,
- .remove = wm8350_regulator_remove,
+ .remove_new = wm8350_regulator_remove,
.driver = {
.name = "wm8350-regulator",
.probe_type = PROBE_PREFER_ASYNCHRONOUS,
--
2.42.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/8] regulator: arizona-ldo1: Convert to platform remove callback returning void
2023-12-05 12:26 ` [PATCH 1/8] regulator: arizona-ldo1: " Uwe Kleine-König
@ 2023-12-05 13:06 ` Charles Keepax
0 siblings, 0 replies; 13+ messages in thread
From: Charles Keepax @ 2023-12-05 13:06 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Liam Girdwood, Mark Brown, patches, linux-kernel, kernel
On Tue, Dec 05, 2023 at 01:26:16PM +0100, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
>
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new(), which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 8/8] regulator: wm8350: Convert to platform remove callback returning void
2023-12-05 12:26 ` [PATCH 8/8] regulator: wm8350: " Uwe Kleine-König
@ 2023-12-05 13:06 ` Charles Keepax
0 siblings, 0 replies; 13+ messages in thread
From: Charles Keepax @ 2023-12-05 13:06 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Liam Girdwood, Mark Brown, patches, linux-kernel, kernel
On Tue, Dec 05, 2023 at 01:26:23PM +0100, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
>
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new(), which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/8] regulator: bd9571mwv: Convert to platform remove callback returning void
2023-12-05 12:26 ` [PATCH 2/8] regulator: bd9571mwv: " Uwe Kleine-König
@ 2023-12-05 14:16 ` Geert Uytterhoeven
0 siblings, 0 replies; 13+ messages in thread
From: Geert Uytterhoeven @ 2023-12-05 14:16 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Liam Girdwood, Mark Brown, Marek Vasut, linux-kernel,
linux-renesas-soc, kernel
On Tue, Dec 5, 2023 at 1:26 PM Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
>
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new(), which already returns void. Eventually after all drivers
> are converted, .remove_new() will be renamed to .remove().
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/8] regulator: Convert to platform remove callback returning void
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
` (7 preceding siblings ...)
2023-12-05 12:26 ` [PATCH 8/8] regulator: wm8350: " Uwe Kleine-König
@ 2023-12-12 15:46 ` Mark Brown
8 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2023-12-12 15:46 UTC (permalink / raw)
To: Liam Girdwood, Uwe Kleine-König
Cc: patches, linux-kernel, Marek Vasut, linux-renesas-soc,
Maxime Coquelin, Alexandre Torgue, linux-stm32, linux-arm-kernel,
Kunihiko Hayashi, Masami Hiramatsu, kernel
On Tue, 05 Dec 2023 13:26:15 +0100, Uwe Kleine-König wrote:
> this series converts all drivers below drivers/regulator to struct
> platform_driver::remove_new(). See commit 5c5a7680e67b ("platform:
> Provide a remove callback that returns no value") for an extended
> explanation and the eventual goal.
>
> All conversations are trivial, because all .remove() callbacks returned
> zero unconditionally.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
Thanks!
[1/8] regulator: arizona-ldo1: Convert to platform remove callback returning void
commit: 03560ff08d2839d7381f18576b329a2eee5cfb37
[2/8] regulator: bd9571mwv: Convert to platform remove callback returning void
commit: cddda6f5f47f7cb13191b7753bc3882940b6f325
[3/8] regulator: db8500-prcmu: Convert to platform remove callback returning void
commit: 0210a60aad02149d8503d259525bfbe0e99f8cb2
[4/8] regulator: stm32-vrefbuf: Convert to platform remove callback returning void
commit: 6f382a0c7ec12f85f4e40d5343ba53f16f543ccb
[5/8] regulator: uniphier: Convert to platform remove callback returning void
commit: 964575179663db70832e374edfacc91539e783d3
[6/8] regulator: userspace-consumer: Convert to platform remove callback returning void
commit: 3b2e8e98692b20436d0346fc6adffff1b596d50f
[7/8] regulator: virtual: Convert to platform remove callback returning void
commit: d637a75ede3db84f7ae4bc2ab398fe2232f22c26
[8/8] regulator: wm8350: Convert to platform remove callback returning void
commit: 8d6fab52f3fdaeb8aabfd046d95e5d3f9464399e
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2023-12-12 15:46 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 12:26 [PATCH 0/8] regulator: Convert to platform remove callback returning void Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 1/8] regulator: arizona-ldo1: " Uwe Kleine-König
2023-12-05 13:06 ` Charles Keepax
2023-12-05 12:26 ` [PATCH 2/8] regulator: bd9571mwv: " Uwe Kleine-König
2023-12-05 14:16 ` Geert Uytterhoeven
2023-12-05 12:26 ` [PATCH 3/8] regulator: db8500-prcmu: " Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 4/8] regulator: stm32-vrefbuf: " Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 5/8] regulator: uniphier: " Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 6/8] regulator: userspace-consumer: " Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 7/8] regulator: virtual: " Uwe Kleine-König
2023-12-05 12:26 ` [PATCH 8/8] regulator: wm8350: " Uwe Kleine-König
2023-12-05 13:06 ` Charles Keepax
2023-12-12 15:46 ` [PATCH 0/8] regulator: " Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®