linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/32] power: supply: Convert to platform remove callback returning void
@ 2023-09-18 13:36 Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 01/32] power: supply: ab8500_btemp: " Uwe Kleine-König
                   ` (32 more replies)
  0 siblings, 33 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Linus Walleij, linux-pm, kernel, Support Opensource,
	Pali Rohár, Krzysztof Kozlowski, Bartosz Golaszewski,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Orson Zhai, Baolin Wang, Chunyan Zhang, patches


Hello,

this series convert all platform drivers below drivers/power/supply to
use remove_new. The motivation is to get rid of an integer return code
that is (mostly) ignored by the platform driver core and error prone on
the driver side.

See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.

There are no interdependencies between the patches. As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply, please apply the remainder of this series anyhow.

Best regards
Uwe

Uwe Kleine-König (32):
  power: supply: ab8500_btemp: Convert to platform remove callback
    returning void
  power: supply: ab8500_chargalg: Convert to platform remove callback
    returning void
  power: supply: ab8500_charger: Convert to platform remove callback
    returning void
  power: supply: ab8500_fg: Convert to platform remove callback
    returning void
  power: supply: acer_a500_battery: Convert to platform remove callback
    returning void
  power: supply: act8945a_charger: Convert to platform remove callback
    returning void
  power: supply: charger-manager: Convert to platform remove callback
    returning void
  power: supply: cpcap-battery: Convert to platform remove callback
    returning void
  power: supply: cpcap-charger: Convert to platform remove callback
    returning void
  power: supply: da9030_battery: Convert to platform remove callback
    returning void
  power: supply: da9052-battery: Convert to platform remove callback
    returning void
  power: supply: da9150-charger: Convert to platform remove callback
    returning void
  power: supply: goldfish_battery: Convert to platform remove callback
    returning void
  power: supply: ipaq_micro_battery: Convert to platform remove callback
    returning void
  power: supply: isp1704_charger: Convert to platform remove callback
    returning void
  power: supply: lp8788-charger: Convert to platform remove callback
    returning void
  power: supply: max14577_charger: Convert to platform remove callback
    returning void
  power: supply: max77650-charger: Convert to platform remove callback
    returning void
  power: supply: max77693_charger: Convert to platform remove callback
    returning void
  power: supply: max8925_power: Convert to platform remove callback
    returning void
  power: supply: pcf50633-charger: Convert to platform remove callback
    returning void
  power: supply: qcom_smbb: Convert to platform remove callback
    returning void
  power: supply: rx51_battery: Convert to platform remove callback
    returning void
  power: supply: sc2731_charger: Convert to platform remove callback
    returning void
  power: supply: tps65090-charger: Convert to platform remove callback
    returning void
  power: supply: tps65217_charger: Convert to platform remove callback
    returning void
  power: supply: twl4030_charger: Convert to platform remove callback
    returning void
  power: supply: twl4030_madc_battery: Convert to platform remove
    callback returning void
  power: supply: wm831x_backup: Convert to platform remove callback
    returning void
  power: supply: wm831x_power: Convert to platform remove callback
    returning void
  power: supply: wm8350_power: Convert to platform remove callback
    returning void
  power: supply: wm97xx_battery: Convert to platform remove callback
    returning void

 drivers/power/supply/ab8500_btemp.c         | 6 ++----
 drivers/power/supply/ab8500_chargalg.c      | 6 ++----
 drivers/power/supply/ab8500_charger.c       | 6 ++----
 drivers/power/supply/ab8500_fg.c            | 6 ++----
 drivers/power/supply/acer_a500_battery.c    | 6 ++----
 drivers/power/supply/act8945a_charger.c     | 6 ++----
 drivers/power/supply/charger-manager.c      | 6 ++----
 drivers/power/supply/cpcap-battery.c        | 6 ++----
 drivers/power/supply/cpcap-charger.c        | 6 ++----
 drivers/power/supply/da9030_battery.c       | 6 ++----
 drivers/power/supply/da9052-battery.c       | 6 ++----
 drivers/power/supply/da9150-charger.c       | 6 ++----
 drivers/power/supply/goldfish_battery.c     | 5 ++---
 drivers/power/supply/ipaq_micro_battery.c   | 6 ++----
 drivers/power/supply/isp1704_charger.c      | 6 ++----
 drivers/power/supply/lp8788-charger.c       | 6 ++----
 drivers/power/supply/max14577_charger.c     | 6 ++----
 drivers/power/supply/max77650-charger.c     | 6 ++----
 drivers/power/supply/max77693_charger.c     | 6 ++----
 drivers/power/supply/max8925_power.c        | 5 ++---
 drivers/power/supply/pcf50633-charger.c     | 6 ++----
 drivers/power/supply/qcom_smbb.c            | 6 ++----
 drivers/power/supply/rx51_battery.c         | 6 ++----
 drivers/power/supply/sc2731_charger.c       | 6 ++----
 drivers/power/supply/tps65090-charger.c     | 6 ++----
 drivers/power/supply/tps65217_charger.c     | 6 ++----
 drivers/power/supply/twl4030_charger.c      | 6 ++----
 drivers/power/supply/twl4030_madc_battery.c | 6 ++----
 drivers/power/supply/wm831x_backup.c        | 6 ++----
 drivers/power/supply/wm831x_power.c         | 5 ++---
 drivers/power/supply/wm8350_power.c         | 5 ++---
 drivers/power/supply/wm97xx_battery.c       | 5 ++---
 32 files changed, 64 insertions(+), 123 deletions(-)


base-commit: 7fc7222d9680366edeecc219c21ca96310bdbc10
-- 
2.40.1


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

* [PATCH 01/32] power: supply: ab8500_btemp: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 02/32] power: supply: ab8500_chargalg: " Uwe Kleine-König
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Linus Walleij, linux-pm, 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() is 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/power/supply/ab8500_btemp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c
index ce36d6ca3422..7905eba93dea 100644
--- a/drivers/power/supply/ab8500_btemp.c
+++ b/drivers/power/supply/ab8500_btemp.c
@@ -804,11 +804,9 @@ static int ab8500_btemp_probe(struct platform_device *pdev)
 	return component_add(dev, &ab8500_btemp_component_ops);
 }
 
-static int ab8500_btemp_remove(struct platform_device *pdev)
+static void ab8500_btemp_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &ab8500_btemp_component_ops);
-
-	return 0;
 }
 
 static SIMPLE_DEV_PM_OPS(ab8500_btemp_pm_ops, ab8500_btemp_suspend, ab8500_btemp_resume);
@@ -821,7 +819,7 @@ MODULE_DEVICE_TABLE(of, ab8500_btemp_match);
 
 struct platform_driver ab8500_btemp_driver = {
 	.probe = ab8500_btemp_probe,
-	.remove = ab8500_btemp_remove,
+	.remove_new = ab8500_btemp_remove,
 	.driver = {
 		.name = "ab8500-btemp",
 		.of_match_table = ab8500_btemp_match,
-- 
2.40.1


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

* [PATCH 02/32] power: supply: ab8500_chargalg: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 01/32] power: supply: ab8500_btemp: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 03/32] power: supply: ab8500_charger: " Uwe Kleine-König
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Linus Walleij, linux-pm, 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() is 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/power/supply/ab8500_chargalg.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/ab8500_chargalg.c b/drivers/power/supply/ab8500_chargalg.c
index 2205ea0834a6..de912658facb 100644
--- a/drivers/power/supply/ab8500_chargalg.c
+++ b/drivers/power/supply/ab8500_chargalg.c
@@ -1824,11 +1824,9 @@ static int ab8500_chargalg_probe(struct platform_device *pdev)
 	return component_add(dev, &ab8500_chargalg_component_ops);
 }
 
-static int ab8500_chargalg_remove(struct platform_device *pdev)
+static void ab8500_chargalg_remove(struct platform_device *pdev)
 {
 	component_del(&pdev->dev, &ab8500_chargalg_component_ops);
-
-	return 0;
 }
 
 static SIMPLE_DEV_PM_OPS(ab8500_chargalg_pm_ops, ab8500_chargalg_suspend, ab8500_chargalg_resume);
@@ -1840,7 +1838,7 @@ static const struct of_device_id ab8500_chargalg_match[] = {
 
 struct platform_driver ab8500_chargalg_driver = {
 	.probe = ab8500_chargalg_probe,
-	.remove = ab8500_chargalg_remove,
+	.remove_new = ab8500_chargalg_remove,
 	.driver = {
 		.name = "ab8500_chargalg",
 		.of_match_table = ab8500_chargalg_match,
-- 
2.40.1


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

* [PATCH 03/32] power: supply: ab8500_charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 01/32] power: supply: ab8500_btemp: " Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 02/32] power: supply: ab8500_chargalg: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 04/32] power: supply: ab8500_fg: " Uwe Kleine-König
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Linus Walleij, linux-pm, 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() is 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/power/supply/ab8500_charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index 308e68545d44..d72f32c663bc 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -3679,7 +3679,7 @@ static int ab8500_charger_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int ab8500_charger_remove(struct platform_device *pdev)
+static void ab8500_charger_remove(struct platform_device *pdev)
 {
 	struct ab8500_charger *di = platform_get_drvdata(pdev);
 
@@ -3688,8 +3688,6 @@ static int ab8500_charger_remove(struct platform_device *pdev)
 	usb_unregister_notifier(di->usb_phy, &di->nb);
 	ab8500_bm_of_remove(di->usb_chg.psy, di->bm);
 	usb_put_phy(di->usb_phy);
-
-	return 0;
 }
 
 static SIMPLE_DEV_PM_OPS(ab8500_charger_pm_ops, ab8500_charger_suspend, ab8500_charger_resume);
@@ -3702,7 +3700,7 @@ MODULE_DEVICE_TABLE(of, ab8500_charger_match);
 
 static struct platform_driver ab8500_charger_driver = {
 	.probe = ab8500_charger_probe,
-	.remove = ab8500_charger_remove,
+	.remove_new = ab8500_charger_remove,
 	.driver = {
 		.name = "ab8500-charger",
 		.of_match_table = ab8500_charger_match,
-- 
2.40.1


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

* [PATCH 04/32] power: supply: ab8500_fg: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 03/32] power: supply: ab8500_charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 05/32] power: supply: acer_a500_battery: " Uwe Kleine-König
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Linus Walleij, linux-pm, 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() is 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/power/supply/ab8500_fg.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c
index 53560fbb6dcd..8c593fbdd45a 100644
--- a/drivers/power/supply/ab8500_fg.c
+++ b/drivers/power/supply/ab8500_fg.c
@@ -3227,7 +3227,7 @@ static int ab8500_fg_probe(struct platform_device *pdev)
 	return component_add(dev, &ab8500_fg_component_ops);
 }
 
-static int ab8500_fg_remove(struct platform_device *pdev)
+static void ab8500_fg_remove(struct platform_device *pdev)
 {
 	struct ab8500_fg *di = platform_get_drvdata(pdev);
 
@@ -3236,8 +3236,6 @@ static int ab8500_fg_remove(struct platform_device *pdev)
 	list_del(&di->node);
 	ab8500_fg_sysfs_exit(di);
 	ab8500_fg_sysfs_psy_remove_attrs(di);
-
-	return 0;
 }
 
 static SIMPLE_DEV_PM_OPS(ab8500_fg_pm_ops, ab8500_fg_suspend, ab8500_fg_resume);
@@ -3250,7 +3248,7 @@ MODULE_DEVICE_TABLE(of, ab8500_fg_match);
 
 struct platform_driver ab8500_fg_driver = {
 	.probe = ab8500_fg_probe,
-	.remove = ab8500_fg_remove,
+	.remove_new = ab8500_fg_remove,
 	.driver = {
 		.name = "ab8500-fg",
 		.of_match_table = ab8500_fg_match,
-- 
2.40.1


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

* [PATCH 05/32] power: supply: acer_a500_battery: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 04/32] power: supply: ab8500_fg: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 06/32] power: supply: act8945a_charger: " Uwe Kleine-König
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/acer_a500_battery.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/acer_a500_battery.c b/drivers/power/supply/acer_a500_battery.c
index 32a0bfcac08f..ef5c419b1b7f 100644
--- a/drivers/power/supply/acer_a500_battery.c
+++ b/drivers/power/supply/acer_a500_battery.c
@@ -251,13 +251,11 @@ static int a500_battery_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int a500_battery_remove(struct platform_device *pdev)
+static void a500_battery_remove(struct platform_device *pdev)
 {
 	struct a500_battery *bat = dev_get_drvdata(&pdev->dev);
 
 	cancel_delayed_work_sync(&bat->poll_work);
-
-	return 0;
 }
 
 static int __maybe_unused a500_battery_suspend(struct device *dev)
@@ -287,7 +285,7 @@ static struct platform_driver a500_battery_driver = {
 		.pm = &a500_battery_pm_ops,
 	},
 	.probe = a500_battery_probe,
-	.remove = a500_battery_remove,
+	.remove_new = a500_battery_remove,
 };
 module_platform_driver(a500_battery_driver);
 
-- 
2.40.1


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

* [PATCH 06/32] power: supply: act8945a_charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 05/32] power: supply: acer_a500_battery: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 07/32] power: supply: charger-manager: " Uwe Kleine-König
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/act8945a_charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/act8945a_charger.c b/drivers/power/supply/act8945a_charger.c
index e9b5f4283772..51122bfbf196 100644
--- a/drivers/power/supply/act8945a_charger.c
+++ b/drivers/power/supply/act8945a_charger.c
@@ -638,14 +638,12 @@ static int act8945a_charger_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int act8945a_charger_remove(struct platform_device *pdev)
+static void act8945a_charger_remove(struct platform_device *pdev)
 {
 	struct act8945a_charger *charger = platform_get_drvdata(pdev);
 
 	charger->init_done = false;
 	cancel_work_sync(&charger->work);
-
-	return 0;
 }
 
 static struct platform_driver act8945a_charger_driver = {
@@ -653,7 +651,7 @@ static struct platform_driver act8945a_charger_driver = {
 		.name = "act8945a-charger",
 	},
 	.probe	= act8945a_charger_probe,
-	.remove = act8945a_charger_remove,
+	.remove_new = act8945a_charger_remove,
 };
 module_platform_driver(act8945a_charger_driver);
 
-- 
2.40.1


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

* [PATCH 07/32] power: supply: charger-manager: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 06/32] power: supply: act8945a_charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 08/32] power: supply: cpcap-battery: " Uwe Kleine-König
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/charger-manager.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 5fa6ba7f41e1..3936ff066600 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1628,7 +1628,7 @@ static int charger_manager_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int charger_manager_remove(struct platform_device *pdev)
+static void charger_manager_remove(struct platform_device *pdev)
 {
 	struct charger_manager *cm = platform_get_drvdata(pdev);
 	struct charger_desc *desc = cm->desc;
@@ -1648,8 +1648,6 @@ static int charger_manager_remove(struct platform_device *pdev)
 	power_supply_unregister(cm->charger_psy);
 
 	try_charger_enable(cm, false);
-
-	return 0;
 }
 
 static const struct platform_device_id charger_manager_id[] = {
@@ -1740,7 +1738,7 @@ static struct platform_driver charger_manager_driver = {
 		.of_match_table = charger_manager_match,
 	},
 	.probe = charger_manager_probe,
-	.remove = charger_manager_remove,
+	.remove_new = charger_manager_remove,
 	.id_table = charger_manager_id,
 };
 
-- 
2.40.1


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

* [PATCH 08/32] power: supply: cpcap-battery: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (6 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 07/32] power: supply: charger-manager: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 09/32] power: supply: cpcap-charger: " Uwe Kleine-König
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/cpcap-battery.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
index 5dd76c0ac98d..30ec76cdf34b 100644
--- a/drivers/power/supply/cpcap-battery.c
+++ b/drivers/power/supply/cpcap-battery.c
@@ -1151,7 +1151,7 @@ static int cpcap_battery_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int cpcap_battery_remove(struct platform_device *pdev)
+static void cpcap_battery_remove(struct platform_device *pdev)
 {
 	struct cpcap_battery_ddata *ddata = platform_get_drvdata(pdev);
 	int error;
@@ -1161,8 +1161,6 @@ static int cpcap_battery_remove(struct platform_device *pdev)
 				   0xffff, 0);
 	if (error)
 		dev_err(&pdev->dev, "could not disable: %i\n", error);
-
-	return 0;
 }
 
 static struct platform_driver cpcap_battery_driver = {
@@ -1171,7 +1169,7 @@ static struct platform_driver cpcap_battery_driver = {
 		.of_match_table = of_match_ptr(cpcap_battery_id_table),
 	},
 	.probe	= cpcap_battery_probe,
-	.remove = cpcap_battery_remove,
+	.remove_new = cpcap_battery_remove,
 };
 module_platform_driver(cpcap_battery_driver);
 
-- 
2.40.1


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

* [PATCH 09/32] power: supply: cpcap-charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (7 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 08/32] power: supply: cpcap-battery: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 10/32] power: supply: da9030_battery: " Uwe Kleine-König
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/cpcap-charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
index be9764541d52..431e951cccf0 100644
--- a/drivers/power/supply/cpcap-charger.c
+++ b/drivers/power/supply/cpcap-charger.c
@@ -966,11 +966,9 @@ static void cpcap_charger_shutdown(struct platform_device *pdev)
 	cancel_delayed_work_sync(&ddata->detect_work);
 }
 
-static int cpcap_charger_remove(struct platform_device *pdev)
+static void cpcap_charger_remove(struct platform_device *pdev)
 {
 	cpcap_charger_shutdown(pdev);
-
-	return 0;
 }
 
 static struct platform_driver cpcap_charger_driver = {
@@ -980,7 +978,7 @@ static struct platform_driver cpcap_charger_driver = {
 		.of_match_table = of_match_ptr(cpcap_charger_id_table),
 	},
 	.shutdown = cpcap_charger_shutdown,
-	.remove	= cpcap_charger_remove,
+	.remove_new = cpcap_charger_remove,
 };
 module_platform_driver(cpcap_charger_driver);
 
-- 
2.40.1


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

* [PATCH 10/32] power: supply: da9030_battery: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (8 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 09/32] power: supply: cpcap-charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 11/32] power: supply: da9052-battery: " Uwe Kleine-König
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/da9030_battery.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/da9030_battery.c b/drivers/power/supply/da9030_battery.c
index 0deba48d22d3..581cf956d2d2 100644
--- a/drivers/power/supply/da9030_battery.c
+++ b/drivers/power/supply/da9030_battery.c
@@ -552,7 +552,7 @@ static int da9030_battery_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int da9030_battery_remove(struct platform_device *dev)
+static void da9030_battery_remove(struct platform_device *dev)
 {
 	struct da9030_charger *charger = platform_get_drvdata(dev);
 
@@ -564,8 +564,6 @@ static int da9030_battery_remove(struct platform_device *dev)
 	cancel_delayed_work_sync(&charger->work);
 	da9030_set_charge(charger, 0);
 	power_supply_unregister(charger->psy);
-
-	return 0;
 }
 
 static struct platform_driver da903x_battery_driver = {
@@ -573,7 +571,7 @@ static struct platform_driver da903x_battery_driver = {
 		.name	= "da903x-battery",
 	},
 	.probe = da9030_battery_probe,
-	.remove = da9030_battery_remove,
+	.remove_new = da9030_battery_remove,
 };
 
 module_platform_driver(da903x_battery_driver);
-- 
2.40.1


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

* [PATCH 11/32] power: supply: da9052-battery: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (9 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 10/32] power: supply: da9030_battery: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 12/32] power: supply: da9150-charger: " Uwe Kleine-König
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Support Opensource, linux-pm, 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() is 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/power/supply/da9052-battery.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/da9052-battery.c b/drivers/power/supply/da9052-battery.c
index d87bdecc9501..6f7c58a41e91 100644
--- a/drivers/power/supply/da9052-battery.c
+++ b/drivers/power/supply/da9052-battery.c
@@ -637,7 +637,7 @@ static s32 da9052_bat_probe(struct platform_device *pdev)
 
 	return ret;
 }
-static int da9052_bat_remove(struct platform_device *pdev)
+static void da9052_bat_remove(struct platform_device *pdev)
 {
 	int i;
 	struct da9052_battery *bat = platform_get_drvdata(pdev);
@@ -646,13 +646,11 @@ static int da9052_bat_remove(struct platform_device *pdev)
 		da9052_free_irq(bat->da9052, da9052_bat_irq_bits[i], bat);
 
 	power_supply_unregister(bat->psy);
-
-	return 0;
 }
 
 static struct platform_driver da9052_bat_driver = {
 	.probe = da9052_bat_probe,
-	.remove = da9052_bat_remove,
+	.remove_new = da9052_bat_remove,
 	.driver = {
 		.name = "da9052-bat",
 	},
-- 
2.40.1


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

* [PATCH 12/32] power: supply: da9150-charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (10 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 11/32] power: supply: da9052-battery: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 13/32] power: supply: goldfish_battery: " Uwe Kleine-König
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Support Opensource, linux-pm, 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() is 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/power/supply/da9150-charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/da9150-charger.c b/drivers/power/supply/da9150-charger.c
index 27f897067aa3..37db9e4ed7f3 100644
--- a/drivers/power/supply/da9150-charger.c
+++ b/drivers/power/supply/da9150-charger.c
@@ -635,7 +635,7 @@ static int da9150_charger_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int da9150_charger_remove(struct platform_device *pdev)
+static void da9150_charger_remove(struct platform_device *pdev)
 {
 	struct da9150_charger *charger = platform_get_drvdata(pdev);
 	int irq;
@@ -665,8 +665,6 @@ static int da9150_charger_remove(struct platform_device *pdev)
 	iio_channel_release(charger->vbus_chan);
 	iio_channel_release(charger->tjunc_chan);
 	iio_channel_release(charger->vbat_chan);
-
-	return 0;
 }
 
 static struct platform_driver da9150_charger_driver = {
@@ -674,7 +672,7 @@ static struct platform_driver da9150_charger_driver = {
 		.name = "da9150-charger",
 	},
 	.probe = da9150_charger_probe,
-	.remove = da9150_charger_remove,
+	.remove_new = da9150_charger_remove,
 };
 
 module_platform_driver(da9150_charger_driver);
-- 
2.40.1


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

* [PATCH 13/32] power: supply: goldfish_battery: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (11 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 12/32] power: supply: da9150-charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 14/32] power: supply: ipaq_micro_battery: " Uwe Kleine-König
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/goldfish_battery.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/goldfish_battery.c b/drivers/power/supply/goldfish_battery.c
index a58d713d75ce..8bb645ad1e5d 100644
--- a/drivers/power/supply/goldfish_battery.c
+++ b/drivers/power/supply/goldfish_battery.c
@@ -249,13 +249,12 @@ static int goldfish_battery_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int goldfish_battery_remove(struct platform_device *pdev)
+static void goldfish_battery_remove(struct platform_device *pdev)
 {
 	struct goldfish_battery_data *data = platform_get_drvdata(pdev);
 
 	power_supply_unregister(data->battery);
 	power_supply_unregister(data->ac);
-	return 0;
 }
 
 static const struct of_device_id goldfish_battery_of_match[] = {
@@ -274,7 +273,7 @@ MODULE_DEVICE_TABLE(acpi, goldfish_battery_acpi_match);
 
 static struct platform_driver goldfish_battery_device = {
 	.probe		= goldfish_battery_probe,
-	.remove		= goldfish_battery_remove,
+	.remove_new	= goldfish_battery_remove,
 	.driver = {
 		.name = "goldfish-battery",
 		.of_match_table = goldfish_battery_of_match,
-- 
2.40.1


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

* [PATCH 14/32] power: supply: ipaq_micro_battery: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (12 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 13/32] power: supply: goldfish_battery: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 15/32] power: supply: isp1704_charger: " Uwe Kleine-König
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/ipaq_micro_battery.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/ipaq_micro_battery.c b/drivers/power/supply/ipaq_micro_battery.c
index 192d9db0fb00..66cc649f702a 100644
--- a/drivers/power/supply/ipaq_micro_battery.c
+++ b/drivers/power/supply/ipaq_micro_battery.c
@@ -265,7 +265,7 @@ static int micro_batt_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int micro_batt_remove(struct platform_device *pdev)
+static void micro_batt_remove(struct platform_device *pdev)
 
 {
 	struct micro_battery *mb = platform_get_drvdata(pdev);
@@ -274,8 +274,6 @@ static int micro_batt_remove(struct platform_device *pdev)
 	power_supply_unregister(micro_batt_power);
 	cancel_delayed_work_sync(&mb->update);
 	destroy_workqueue(mb->wq);
-
-	return 0;
 }
 
 static int __maybe_unused micro_batt_suspend(struct device *dev)
@@ -304,7 +302,7 @@ static struct platform_driver micro_batt_device_driver = {
 		.pm	= &micro_batt_dev_pm_ops,
 	},
 	.probe		= micro_batt_probe,
-	.remove		= micro_batt_remove,
+	.remove_new	= micro_batt_remove,
 };
 module_platform_driver(micro_batt_device_driver);
 
-- 
2.40.1


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

* [PATCH 15/32] power: supply: isp1704_charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (13 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 14/32] power: supply: ipaq_micro_battery: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 16/32] power: supply: lp8788-charger: " Uwe Kleine-König
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Pali Rohár, linux-pm, 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() is 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/power/supply/isp1704_charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/isp1704_charger.c b/drivers/power/supply/isp1704_charger.c
index b6efc454e4f0..860d8614c98f 100644
--- a/drivers/power/supply/isp1704_charger.c
+++ b/drivers/power/supply/isp1704_charger.c
@@ -477,15 +477,13 @@ static int isp1704_charger_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int isp1704_charger_remove(struct platform_device *pdev)
+static void isp1704_charger_remove(struct platform_device *pdev)
 {
 	struct isp1704_charger *isp = platform_get_drvdata(pdev);
 
 	usb_unregister_notifier(isp->phy, &isp->nb);
 	power_supply_unregister(isp->psy);
 	isp1704_charger_set_power(isp, 0);
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -503,7 +501,7 @@ static struct platform_driver isp1704_charger_driver = {
 		.of_match_table = of_match_ptr(omap_isp1704_of_match),
 	},
 	.probe = isp1704_charger_probe,
-	.remove = isp1704_charger_remove,
+	.remove_new = isp1704_charger_remove,
 };
 
 module_platform_driver(isp1704_charger_driver);
-- 
2.40.1


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

* [PATCH 16/32] power: supply: lp8788-charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (14 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 15/32] power: supply: isp1704_charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 17/32] power: supply: max14577_charger: " Uwe Kleine-König
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/lp8788-charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/lp8788-charger.c b/drivers/power/supply/lp8788-charger.c
index 755b6a4379b8..2c81be82a41a 100644
--- a/drivers/power/supply/lp8788-charger.c
+++ b/drivers/power/supply/lp8788-charger.c
@@ -714,20 +714,18 @@ static int lp8788_charger_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int lp8788_charger_remove(struct platform_device *pdev)
+static void lp8788_charger_remove(struct platform_device *pdev)
 {
 	struct lp8788_charger *pchg = platform_get_drvdata(pdev);
 
 	flush_work(&pchg->charger_work);
 	lp8788_irq_unregister(pdev, pchg);
 	lp8788_psy_unregister(pchg);
-
-	return 0;
 }
 
 static struct platform_driver lp8788_charger_driver = {
 	.probe = lp8788_charger_probe,
-	.remove = lp8788_charger_remove,
+	.remove_new = lp8788_charger_remove,
 	.driver = {
 		.name = LP8788_DEV_CHARGER,
 	},
-- 
2.40.1


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

* [PATCH 17/32] power: supply: max14577_charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (15 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 16/32] power: supply: lp8788-charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 18/32] power: supply: max77650-charger: " Uwe Kleine-König
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Krzysztof Kozlowski, linux-pm, 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() is 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/power/supply/max14577_charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/max14577_charger.c b/drivers/power/supply/max14577_charger.c
index 96f9de775043..7c23fa89ea19 100644
--- a/drivers/power/supply/max14577_charger.c
+++ b/drivers/power/supply/max14577_charger.c
@@ -606,14 +606,12 @@ static int max14577_charger_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int max14577_charger_remove(struct platform_device *pdev)
+static void max14577_charger_remove(struct platform_device *pdev)
 {
 	struct max14577_charger *chg = platform_get_drvdata(pdev);
 
 	device_remove_file(&pdev->dev, &dev_attr_fast_charge_timer);
 	power_supply_unregister(chg->charger);
-
-	return 0;
 }
 
 static const struct platform_device_id max14577_charger_id[] = {
@@ -638,7 +636,7 @@ static struct platform_driver max14577_charger_driver = {
 		.of_match_table = of_max14577_charger_dt_match,
 	},
 	.probe		= max14577_charger_probe,
-	.remove		= max14577_charger_remove,
+	.remove_new	= max14577_charger_remove,
 	.id_table	= max14577_charger_id,
 };
 module_platform_driver(max14577_charger_driver);
-- 
2.40.1


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

* [PATCH 18/32] power: supply: max77650-charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (16 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 17/32] power: supply: max14577_charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 19/32] power: supply: max77693_charger: " Uwe Kleine-König
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Bartosz Golaszewski, kernel, linux-pm

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() is 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/power/supply/max77650-charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/max77650-charger.c b/drivers/power/supply/max77650-charger.c
index e8c25da40ab2..818e13c613e3 100644
--- a/drivers/power/supply/max77650-charger.c
+++ b/drivers/power/supply/max77650-charger.c
@@ -345,13 +345,11 @@ static int max77650_charger_probe(struct platform_device *pdev)
 	return max77650_charger_enable(chg);
 }
 
-static int max77650_charger_remove(struct platform_device *pdev)
+static void max77650_charger_remove(struct platform_device *pdev)
 {
 	struct max77650_charger_data *chg = platform_get_drvdata(pdev);
 
 	max77650_charger_disable(chg);
-
-	return 0;
 }
 
 static const struct of_device_id max77650_charger_of_match[] = {
@@ -366,7 +364,7 @@ static struct platform_driver max77650_charger_driver = {
 		.of_match_table = max77650_charger_of_match,
 	},
 	.probe = max77650_charger_probe,
-	.remove = max77650_charger_remove,
+	.remove_new = max77650_charger_remove,
 };
 module_platform_driver(max77650_charger_driver);
 
-- 
2.40.1


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

* [PATCH 19/32] power: supply: max77693_charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (17 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 18/32] power: supply: max77650-charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 20/32] power: supply: max8925_power: " Uwe Kleine-König
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Krzysztof Kozlowski, linux-pm, 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() is 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/power/supply/max77693_charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/max77693_charger.c b/drivers/power/supply/max77693_charger.c
index 794c8c054450..d0157e63b8b5 100644
--- a/drivers/power/supply/max77693_charger.c
+++ b/drivers/power/supply/max77693_charger.c
@@ -728,7 +728,7 @@ static int max77693_charger_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int max77693_charger_remove(struct platform_device *pdev)
+static void max77693_charger_remove(struct platform_device *pdev)
 {
 	struct max77693_charger *chg = platform_get_drvdata(pdev);
 
@@ -737,8 +737,6 @@ static int max77693_charger_remove(struct platform_device *pdev)
 	device_remove_file(&pdev->dev, &dev_attr_fast_charge_timer);
 
 	power_supply_unregister(chg->charger);
-
-	return 0;
 }
 
 static const struct platform_device_id max77693_charger_id[] = {
@@ -752,7 +750,7 @@ static struct platform_driver max77693_charger_driver = {
 		.name	= "max77693-charger",
 	},
 	.probe		= max77693_charger_probe,
-	.remove		= max77693_charger_remove,
+	.remove_new	= max77693_charger_remove,
 	.id_table	= max77693_charger_id,
 };
 module_platform_driver(max77693_charger_driver);
-- 
2.40.1


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

* [PATCH 20/32] power: supply: max8925_power: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (18 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 19/32] power: supply: max77693_charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 21/32] power: supply: pcf50633-charger: " Uwe Kleine-König
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/max8925_power.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/max8925_power.c b/drivers/power/supply/max8925_power.c
index 8878f9131184..4a2d6894f94e 100644
--- a/drivers/power/supply/max8925_power.c
+++ b/drivers/power/supply/max8925_power.c
@@ -566,7 +566,7 @@ static int max8925_power_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int max8925_power_remove(struct platform_device *pdev)
+static void max8925_power_remove(struct platform_device *pdev)
 {
 	struct max8925_power_info *info = platform_get_drvdata(pdev);
 
@@ -576,12 +576,11 @@ static int max8925_power_remove(struct platform_device *pdev)
 		power_supply_unregister(info->battery);
 		max8925_deinit_charger(info);
 	}
-	return 0;
 }
 
 static struct platform_driver max8925_power_driver = {
 	.probe	= max8925_power_probe,
-	.remove	= max8925_power_remove,
+	.remove_new = max8925_power_remove,
 	.driver	= {
 		.name	= "max8925-power",
 	},
-- 
2.40.1


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

* [PATCH 21/32] power: supply: pcf50633-charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (19 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 20/32] power: supply: max8925_power: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 22/32] power: supply: qcom_smbb: " Uwe Kleine-König
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/pcf50633-charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/pcf50633-charger.c b/drivers/power/supply/pcf50633-charger.c
index fd44cb8ac0e2..950e30917c63 100644
--- a/drivers/power/supply/pcf50633-charger.c
+++ b/drivers/power/supply/pcf50633-charger.c
@@ -441,7 +441,7 @@ static int pcf50633_mbc_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int pcf50633_mbc_remove(struct platform_device *pdev)
+static void pcf50633_mbc_remove(struct platform_device *pdev)
 {
 	struct pcf50633_mbc *mbc = platform_get_drvdata(pdev);
 	int i;
@@ -453,8 +453,6 @@ static int pcf50633_mbc_remove(struct platform_device *pdev)
 	power_supply_unregister(mbc->usb);
 	power_supply_unregister(mbc->adapter);
 	power_supply_unregister(mbc->ac);
-
-	return 0;
 }
 
 static struct platform_driver pcf50633_mbc_driver = {
@@ -462,7 +460,7 @@ static struct platform_driver pcf50633_mbc_driver = {
 		.name = "pcf50633-mbc",
 	},
 	.probe = pcf50633_mbc_probe,
-	.remove = pcf50633_mbc_remove,
+	.remove_new = pcf50633_mbc_remove,
 };
 
 module_platform_driver(pcf50633_mbc_driver);
-- 
2.40.1


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

* [PATCH 22/32] power: supply: qcom_smbb: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (20 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 21/32] power: supply: pcf50633-charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 23:51   ` Konrad Dybcio
  2023-09-18 13:36 ` [PATCH 23/32] power: supply: rx51_battery: " Uwe Kleine-König
                   ` (10 subsequent siblings)
  32 siblings, 1 reply; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	linux-pm, 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() is 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/power/supply/qcom_smbb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/qcom_smbb.c b/drivers/power/supply/qcom_smbb.c
index bd50124eef9f..4e57762e27ba 100644
--- a/drivers/power/supply/qcom_smbb.c
+++ b/drivers/power/supply/qcom_smbb.c
@@ -1000,15 +1000,13 @@ static int smbb_charger_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int smbb_charger_remove(struct platform_device *pdev)
+static void smbb_charger_remove(struct platform_device *pdev)
 {
 	struct smbb_charger *chg;
 
 	chg = platform_get_drvdata(pdev);
 
 	regmap_update_bits(chg->regmap, chg->addr + SMBB_CHG_CTRL, CTRL_EN, 0);
-
-	return 0;
 }
 
 static const struct of_device_id smbb_charger_id_table[] = {
@@ -1020,7 +1018,7 @@ MODULE_DEVICE_TABLE(of, smbb_charger_id_table);
 
 static struct platform_driver smbb_charger_driver = {
 	.probe	  = smbb_charger_probe,
-	.remove	 = smbb_charger_remove,
+	.remove_new	 = smbb_charger_remove,
 	.driver	 = {
 		.name   = "qcom-smbb",
 		.of_match_table = smbb_charger_id_table,
-- 
2.40.1


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

* [PATCH 23/32] power: supply: rx51_battery: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (21 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 22/32] power: supply: qcom_smbb: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 24/32] power: supply: sc2731_charger: " Uwe Kleine-König
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: Pali Rohár, linux-pm, 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() is 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/power/supply/rx51_battery.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/rx51_battery.c b/drivers/power/supply/rx51_battery.c
index 6e488ecf4dcb..e2bfc81f0fd9 100644
--- a/drivers/power/supply/rx51_battery.c
+++ b/drivers/power/supply/rx51_battery.c
@@ -246,7 +246,7 @@ static int rx51_battery_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int rx51_battery_remove(struct platform_device *pdev)
+static void rx51_battery_remove(struct platform_device *pdev)
 {
 	struct rx51_device_info *di = platform_get_drvdata(pdev);
 
@@ -255,8 +255,6 @@ static int rx51_battery_remove(struct platform_device *pdev)
 	iio_channel_release(di->channel_vbat);
 	iio_channel_release(di->channel_bsi);
 	iio_channel_release(di->channel_temp);
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -269,7 +267,7 @@ MODULE_DEVICE_TABLE(of, n900_battery_of_match);
 
 static struct platform_driver rx51_battery_driver = {
 	.probe = rx51_battery_probe,
-	.remove = rx51_battery_remove,
+	.remove_new = rx51_battery_remove,
 	.driver = {
 		.name = "rx51-battery",
 		.of_match_table = of_match_ptr(n900_battery_of_match),
-- 
2.40.1


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

* [PATCH 24/32] power: supply: sc2731_charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (22 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 23/32] power: supply: rx51_battery: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 25/32] power: supply: tps65090-charger: " Uwe Kleine-König
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Orson Zhai, Baolin Wang, Chunyan Zhang, linux-pm, 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() is 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/power/supply/sc2731_charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/sc2731_charger.c b/drivers/power/supply/sc2731_charger.c
index 9ac17cf7a126..b3d8b1ca97da 100644
--- a/drivers/power/supply/sc2731_charger.c
+++ b/drivers/power/supply/sc2731_charger.c
@@ -511,13 +511,11 @@ static int sc2731_charger_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int sc2731_charger_remove(struct platform_device *pdev)
+static void sc2731_charger_remove(struct platform_device *pdev)
 {
 	struct sc2731_charger_info *info = platform_get_drvdata(pdev);
 
 	usb_unregister_notifier(info->usb_phy, &info->usb_notify);
-
-	return 0;
 }
 
 static const struct of_device_id sc2731_charger_of_match[] = {
@@ -532,7 +530,7 @@ static struct platform_driver sc2731_charger_driver = {
 		.of_match_table = sc2731_charger_of_match,
 	},
 	.probe = sc2731_charger_probe,
-	.remove = sc2731_charger_remove,
+	.remove_new = sc2731_charger_remove,
 };
 
 module_platform_driver(sc2731_charger_driver);
-- 
2.40.1


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

* [PATCH 25/32] power: supply: tps65090-charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (23 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 24/32] power: supply: sc2731_charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 26/32] power: supply: tps65217_charger: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/tps65090-charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/tps65090-charger.c b/drivers/power/supply/tps65090-charger.c
index f96c705e0a9f..c59197d2aa87 100644
--- a/drivers/power/supply/tps65090-charger.c
+++ b/drivers/power/supply/tps65090-charger.c
@@ -328,15 +328,13 @@ static int tps65090_charger_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int tps65090_charger_remove(struct platform_device *pdev)
+static void tps65090_charger_remove(struct platform_device *pdev)
 {
 	struct tps65090_charger *cdata = platform_get_drvdata(pdev);
 
 	if (cdata->irq == -ENXIO)
 		kthread_stop(cdata->poll_task);
 	power_supply_unregister(cdata->ac);
-
-	return 0;
 }
 
 static const struct of_device_id of_tps65090_charger_match[] = {
@@ -351,7 +349,7 @@ static struct platform_driver tps65090_charger_driver = {
 		.of_match_table = of_tps65090_charger_match,
 	},
 	.probe	= tps65090_charger_probe,
-	.remove = tps65090_charger_remove,
+	.remove_new = tps65090_charger_remove,
 };
 module_platform_driver(tps65090_charger_driver);
 
-- 
2.40.1


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

* [PATCH 26/32] power: supply: tps65217_charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (24 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 25/32] power: supply: tps65090-charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 27/32] power: supply: twl4030_charger: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/tps65217_charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/tps65217_charger.c b/drivers/power/supply/tps65217_charger.c
index 96341cbde4fa..b3a1ba326a3e 100644
--- a/drivers/power/supply/tps65217_charger.c
+++ b/drivers/power/supply/tps65217_charger.c
@@ -253,14 +253,12 @@ static int tps65217_charger_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int tps65217_charger_remove(struct platform_device *pdev)
+static void tps65217_charger_remove(struct platform_device *pdev)
 {
 	struct tps65217_charger *charger = platform_get_drvdata(pdev);
 
 	if (charger->poll_task)
 		kthread_stop(charger->poll_task);
-
-	return 0;
 }
 
 static const struct of_device_id tps65217_charger_match_table[] = {
@@ -271,7 +269,7 @@ MODULE_DEVICE_TABLE(of, tps65217_charger_match_table);
 
 static struct platform_driver tps65217_charger_driver = {
 	.probe	= tps65217_charger_probe,
-	.remove = tps65217_charger_remove,
+	.remove_new = tps65217_charger_remove,
 	.driver	= {
 		.name	= "tps65217-charger",
 		.of_match_table = of_match_ptr(tps65217_charger_match_table),
-- 
2.40.1


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

* [PATCH 27/32] power: supply: twl4030_charger: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (25 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 26/32] power: supply: tps65217_charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 28/32] power: supply: twl4030_madc_battery: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/twl4030_charger.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/supply/twl4030_charger.c
index e78d061d8d32..7b9b0b3e164e 100644
--- a/drivers/power/supply/twl4030_charger.c
+++ b/drivers/power/supply/twl4030_charger.c
@@ -1108,7 +1108,7 @@ static int twl4030_bci_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int twl4030_bci_remove(struct platform_device *pdev)
+static void twl4030_bci_remove(struct platform_device *pdev)
 {
 	struct twl4030_bci *bci = platform_get_drvdata(pdev);
 
@@ -1123,8 +1123,6 @@ static int twl4030_bci_remove(struct platform_device *pdev)
 			 TWL4030_INTERRUPTS_BCIIMR1A);
 	twl_i2c_write_u8(TWL4030_MODULE_INTERRUPTS, 0xff,
 			 TWL4030_INTERRUPTS_BCIIMR2A);
-
-	return 0;
 }
 
 static const struct of_device_id twl_bci_of_match[] __maybe_unused = {
@@ -1135,7 +1133,7 @@ MODULE_DEVICE_TABLE(of, twl_bci_of_match);
 
 static struct platform_driver twl4030_bci_driver = {
 	.probe = twl4030_bci_probe,
-	.remove	= twl4030_bci_remove,
+	.remove_new = twl4030_bci_remove,
 	.driver	= {
 		.name	= "twl4030_bci",
 		.of_match_table = of_match_ptr(twl_bci_of_match),
-- 
2.40.1


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

* [PATCH 28/32] power: supply: twl4030_madc_battery: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (26 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 27/32] power: supply: twl4030_charger: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 29/32] power: supply: wm831x_backup: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/twl4030_madc_battery.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/twl4030_madc_battery.c b/drivers/power/supply/twl4030_madc_battery.c
index 7fe029673b22..33106476bea2 100644
--- a/drivers/power/supply/twl4030_madc_battery.c
+++ b/drivers/power/supply/twl4030_madc_battery.c
@@ -244,7 +244,7 @@ static int twl4030_madc_battery_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int twl4030_madc_battery_remove(struct platform_device *pdev)
+static void twl4030_madc_battery_remove(struct platform_device *pdev)
 {
 	struct twl4030_madc_battery *bat = platform_get_drvdata(pdev);
 
@@ -253,8 +253,6 @@ static int twl4030_madc_battery_remove(struct platform_device *pdev)
 	iio_channel_release(bat->channel_vbat);
 	iio_channel_release(bat->channel_ichg);
 	iio_channel_release(bat->channel_temp);
-
-	return 0;
 }
 
 static struct platform_driver twl4030_madc_battery_driver = {
@@ -262,7 +260,7 @@ static struct platform_driver twl4030_madc_battery_driver = {
 		.name = "twl4030_madc_battery",
 	},
 	.probe  = twl4030_madc_battery_probe,
-	.remove = twl4030_madc_battery_remove,
+	.remove_new = twl4030_madc_battery_remove,
 };
 module_platform_driver(twl4030_madc_battery_driver);
 
-- 
2.40.1


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

* [PATCH 29/32] power: supply: wm831x_backup: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (27 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 28/32] power: supply: twl4030_madc_battery: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 30/32] power: supply: wm831x_power: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: patches, linux-pm, 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() is 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/power/supply/wm831x_backup.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/power/supply/wm831x_backup.c b/drivers/power/supply/wm831x_backup.c
index ffb265b8526d..1a7265660ade 100644
--- a/drivers/power/supply/wm831x_backup.c
+++ b/drivers/power/supply/wm831x_backup.c
@@ -197,18 +197,16 @@ static int wm831x_backup_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(devdata->backup);
 }
 
-static int wm831x_backup_remove(struct platform_device *pdev)
+static void wm831x_backup_remove(struct platform_device *pdev)
 {
 	struct wm831x_backup *devdata = platform_get_drvdata(pdev);
 
 	power_supply_unregister(devdata->backup);
-
-	return 0;
 }
 
 static struct platform_driver wm831x_backup_driver = {
 	.probe = wm831x_backup_probe,
-	.remove = wm831x_backup_remove,
+	.remove_new = wm831x_backup_remove,
 	.driver = {
 		.name = "wm831x-backup",
 	},
-- 
2.40.1


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

* [PATCH 30/32] power: supply: wm831x_power: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (28 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 29/32] power: supply: wm831x_backup: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:36 ` [PATCH 31/32] power: supply: wm8350_power: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: patches, linux-pm, 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() is 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/power/supply/wm831x_power.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/wm831x_power.c b/drivers/power/supply/wm831x_power.c
index 82e31066c746..e49b01ee5f3e 100644
--- a/drivers/power/supply/wm831x_power.c
+++ b/drivers/power/supply/wm831x_power.c
@@ -694,7 +694,7 @@ static int wm831x_power_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int wm831x_power_remove(struct platform_device *pdev)
+static void wm831x_power_remove(struct platform_device *pdev)
 {
 	struct wm831x_power *wm831x_power = platform_get_drvdata(pdev);
 	struct wm831x *wm831x = wm831x_power->wm831x;
@@ -722,12 +722,11 @@ static int wm831x_power_remove(struct platform_device *pdev)
 		power_supply_unregister(wm831x_power->battery);
 	power_supply_unregister(wm831x_power->wall);
 	power_supply_unregister(wm831x_power->usb);
-	return 0;
 }
 
 static struct platform_driver wm831x_power_driver = {
 	.probe = wm831x_power_probe,
-	.remove = wm831x_power_remove,
+	.remove_new = wm831x_power_remove,
 	.driver = {
 		.name = "wm831x-power",
 	},
-- 
2.40.1


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

* [PATCH 31/32] power: supply: wm8350_power: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (29 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 30/32] power: supply: wm831x_power: " Uwe Kleine-König
@ 2023-09-18 13:36 ` Uwe Kleine-König
  2023-09-18 13:37 ` [PATCH 32/32] power: supply: wm97xx_battery: " Uwe Kleine-König
  2023-09-18 18:12 ` [PATCH 00/32] power: supply: " Sebastian Reichel
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:36 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: patches, linux-pm, 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() is 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/power/supply/wm8350_power.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/wm8350_power.c b/drivers/power/supply/wm8350_power.c
index f2786761299c..f23b4f5343bc 100644
--- a/drivers/power/supply/wm8350_power.c
+++ b/drivers/power/supply/wm8350_power.c
@@ -579,7 +579,7 @@ static int wm8350_power_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int wm8350_power_remove(struct platform_device *pdev)
+static void wm8350_power_remove(struct platform_device *pdev)
 {
 	struct wm8350 *wm8350 = platform_get_drvdata(pdev);
 	struct wm8350_power *power = &wm8350->power;
@@ -589,12 +589,11 @@ static int wm8350_power_remove(struct platform_device *pdev)
 	power_supply_unregister(power->battery);
 	power_supply_unregister(power->ac);
 	power_supply_unregister(power->usb);
-	return 0;
 }
 
 static struct platform_driver wm8350_power_driver = {
 	.probe = wm8350_power_probe,
-	.remove = wm8350_power_remove,
+	.remove_new = wm8350_power_remove,
 	.driver = {
 		.name = "wm8350-power",
 	},
-- 
2.40.1


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

* [PATCH 32/32] power: supply: wm97xx_battery: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (30 preceding siblings ...)
  2023-09-18 13:36 ` [PATCH 31/32] power: supply: wm8350_power: " Uwe Kleine-König
@ 2023-09-18 13:37 ` Uwe Kleine-König
  2023-09-18 18:12 ` [PATCH 00/32] power: supply: " Sebastian Reichel
  32 siblings, 0 replies; 35+ messages in thread
From: Uwe Kleine-König @ 2023-09-18 13:37 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, 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() is 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/power/supply/wm97xx_battery.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/wm97xx_battery.c b/drivers/power/supply/wm97xx_battery.c
index f4b190adb335..1cc38d1437d9 100644
--- a/drivers/power/supply/wm97xx_battery.c
+++ b/drivers/power/supply/wm97xx_battery.c
@@ -248,14 +248,13 @@ static int wm97xx_bat_probe(struct platform_device *dev)
 	return ret;
 }
 
-static int wm97xx_bat_remove(struct platform_device *dev)
+static void wm97xx_bat_remove(struct platform_device *dev)
 {
 	if (charge_gpiod)
 		free_irq(gpiod_to_irq(charge_gpiod), dev);
 	cancel_work_sync(&bat_work);
 	power_supply_unregister(bat_psy);
 	kfree(prop);
-	return 0;
 }
 
 static struct platform_driver wm97xx_bat_driver = {
@@ -266,7 +265,7 @@ static struct platform_driver wm97xx_bat_driver = {
 #endif
 	},
 	.probe		= wm97xx_bat_probe,
-	.remove		= wm97xx_bat_remove,
+	.remove_new	= wm97xx_bat_remove,
 };
 
 module_platform_driver(wm97xx_bat_driver);
-- 
2.40.1


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

* Re: [PATCH 00/32] power: supply: Convert to platform remove callback returning void
  2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (31 preceding siblings ...)
  2023-09-18 13:37 ` [PATCH 32/32] power: supply: wm97xx_battery: " Uwe Kleine-König
@ 2023-09-18 18:12 ` Sebastian Reichel
  32 siblings, 0 replies; 35+ messages in thread
From: Sebastian Reichel @ 2023-09-18 18:12 UTC (permalink / raw)
  To: Sebastian Reichel, Uwe Kleine-König
  Cc: Linus Walleij, linux-pm, kernel, Support Opensource,
	Pali Rohár, Krzysztof Kozlowski, Bartosz Golaszewski,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Orson Zhai, Baolin Wang, Chunyan Zhang, patches


On Mon, 18 Sep 2023 15:36:28 +0200, Uwe Kleine-König wrote:
> this series convert all platform drivers below drivers/power/supply to
> use remove_new. The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.
> 
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
> 
> [...]

Applied, thanks!

[01/32] power: supply: ab8500_btemp: Convert to platform remove callback returning void
        commit: dab952c77e5a0bad3a391b8cbb6995f32c9a7b6d
[02/32] power: supply: ab8500_chargalg: Convert to platform remove callback returning void
        commit: 465ec888880be0f3170b97a0e975bcb1e9b6961b
[03/32] power: supply: ab8500_charger: Convert to platform remove callback returning void
        commit: c5b08e1bfe087c42e43e64f308b16c6f79444dc9
[04/32] power: supply: ab8500_fg: Convert to platform remove callback returning void
        commit: 59016f4c0e106ec9ba3ac039bf7e96a474648ea6
[05/32] power: supply: acer_a500_battery: Convert to platform remove callback returning void
        commit: 179297b95198526fbef8f6b92f1b486502144861
[06/32] power: supply: act8945a_charger: Convert to platform remove callback returning void
        commit: 7a9a4966777b8df6e6f97f82073f4736a5274358
[07/32] power: supply: charger-manager: Convert to platform remove callback returning void
        commit: 403eebf95c38302cacc48c127e575461f0e798be
[08/32] power: supply: cpcap-battery: Convert to platform remove callback returning void
        commit: 02fecba679bbac3b16c2245e8e462b19fb36cedd
[09/32] power: supply: cpcap-charger: Convert to platform remove callback returning void
        commit: 1abbcff9f0c087e88ae542e0d6b0ee0689881027
[10/32] power: supply: da9030_battery: Convert to platform remove callback returning void
        commit: b5ba26ab7a886567759b793161cdd0aae4a76910
[11/32] power: supply: da9052-battery: Convert to platform remove callback returning void
        commit: ac67d7fd4e1bad9eac25c3a1a07e4aceda6e1ce3
[12/32] power: supply: da9150-charger: Convert to platform remove callback returning void
        commit: 749e18a800569e894e82fb5f68edd447311f9675
[13/32] power: supply: goldfish_battery: Convert to platform remove callback returning void
        commit: df1953bcb723538faff6ebb403ac321797f3b04f
[14/32] power: supply: ipaq_micro_battery: Convert to platform remove callback returning void
        commit: cbc3e1136d1f8b934cc41b4bc12f5c732d543c59
[15/32] power: supply: isp1704_charger: Convert to platform remove callback returning void
        commit: cf79047ed4a33704dd465723175041c22091d24c
[16/32] power: supply: lp8788-charger: Convert to platform remove callback returning void
        commit: 7810ba3c5110ce66652ec6bd2abb92da5d726c3b
[17/32] power: supply: max14577_charger: Convert to platform remove callback returning void
        commit: 81e487b8a4af24c28a3d5c90a6035356098720bb
[18/32] power: supply: max77650-charger: Convert to platform remove callback returning void
        commit: cd25ac3e3200626680dac92c9784cce4d59fdc6b
[19/32] power: supply: max77693_charger: Convert to platform remove callback returning void
        commit: 1d138270d2963b68d71852c363298460ea7435c7
[20/32] power: supply: max8925_power: Convert to platform remove callback returning void
        commit: 026f25f221866ea89a33697935995db6a1c25a52
[21/32] power: supply: pcf50633-charger: Convert to platform remove callback returning void
        commit: 6e3ed20e85aacaed7d3deede835a97029ea14560
[22/32] power: supply: qcom_smbb: Convert to platform remove callback returning void
        commit: 325cb83bbabcafa3e54528d40c86559dde271bc3
[23/32] power: supply: rx51_battery: Convert to platform remove callback returning void
        commit: 9f0da40ae798d3f32d649d1effef246f2c30f13e
[24/32] power: supply: sc2731_charger: Convert to platform remove callback returning void
        commit: 0569d4cfa800ba303647dbf8170d1e89bdee3ed9
[25/32] power: supply: tps65090-charger: Convert to platform remove callback returning void
        commit: 75d8365c94b685dd7377b0251d2407518dc49c02
[26/32] power: supply: tps65217_charger: Convert to platform remove callback returning void
        commit: 07a9398914327bb16584f24dfba02062a5967ab1
[27/32] power: supply: twl4030_charger: Convert to platform remove callback returning void
        commit: 83ef1dbc0de4a127661a175350696e9cfa88bbb1
[28/32] power: supply: twl4030_madc_battery: Convert to platform remove callback returning void
        commit: ac51982b04a05eb902a223b3bc83c032903b6ba7
[29/32] power: supply: wm831x_backup: Convert to platform remove callback returning void
        commit: fc7b34ae1347f4eb36f065458e53d6065cd85928
[30/32] power: supply: wm831x_power: Convert to platform remove callback returning void
        commit: dab68bbb5450ee17c9acf77916ac2ed659b1e2a7
[31/32] power: supply: wm8350_power: Convert to platform remove callback returning void
        commit: 42720969f394dc074ce1c99cd0c425b7dd6017ee
[32/32] power: supply: wm97xx_battery: Convert to platform remove callback returning void
        commit: 6f9fb8afe649a24c7df50ce2f7095b832713e648

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


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

* Re: [PATCH 22/32] power: supply: qcom_smbb: Convert to platform remove callback returning void
  2023-09-18 13:36 ` [PATCH 22/32] power: supply: qcom_smbb: " Uwe Kleine-König
@ 2023-09-18 23:51   ` Konrad Dybcio
  0 siblings, 0 replies; 35+ messages in thread
From: Konrad Dybcio @ 2023-09-18 23:51 UTC (permalink / raw)
  To: Uwe Kleine-König, Sebastian Reichel
  Cc: Andy Gross, Bjorn Andersson, linux-arm-msm, linux-pm, kernel



On 9/18/23 15:36, 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() is 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: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

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

end of thread, other threads:[~2023-09-18 23:51 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-18 13:36 [PATCH 00/32] power: supply: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 01/32] power: supply: ab8500_btemp: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 02/32] power: supply: ab8500_chargalg: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 03/32] power: supply: ab8500_charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 04/32] power: supply: ab8500_fg: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 05/32] power: supply: acer_a500_battery: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 06/32] power: supply: act8945a_charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 07/32] power: supply: charger-manager: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 08/32] power: supply: cpcap-battery: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 09/32] power: supply: cpcap-charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 10/32] power: supply: da9030_battery: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 11/32] power: supply: da9052-battery: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 12/32] power: supply: da9150-charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 13/32] power: supply: goldfish_battery: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 14/32] power: supply: ipaq_micro_battery: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 15/32] power: supply: isp1704_charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 16/32] power: supply: lp8788-charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 17/32] power: supply: max14577_charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 18/32] power: supply: max77650-charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 19/32] power: supply: max77693_charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 20/32] power: supply: max8925_power: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 21/32] power: supply: pcf50633-charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 22/32] power: supply: qcom_smbb: " Uwe Kleine-König
2023-09-18 23:51   ` Konrad Dybcio
2023-09-18 13:36 ` [PATCH 23/32] power: supply: rx51_battery: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 24/32] power: supply: sc2731_charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 25/32] power: supply: tps65090-charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 26/32] power: supply: tps65217_charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 27/32] power: supply: twl4030_charger: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 28/32] power: supply: twl4030_madc_battery: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 29/32] power: supply: wm831x_backup: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 30/32] power: supply: wm831x_power: " Uwe Kleine-König
2023-09-18 13:36 ` [PATCH 31/32] power: supply: wm8350_power: " Uwe Kleine-König
2023-09-18 13:37 ` [PATCH 32/32] power: supply: wm97xx_battery: " Uwe Kleine-König
2023-09-18 18:12 ` [PATCH 00/32] power: supply: " Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).