linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] backlight: Convert to platform remove callback returning void
@ 2023-03-08  7:39 Uwe Kleine-König
  2023-03-08  7:39 ` [PATCH 01/13] backlight: aat2870_bl: " Uwe Kleine-König
                   ` (13 more replies)
  0 siblings, 14 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller,
	Michael Hennerich, Support Opensource, Matthias Brugger,
	Thierry Reding, Andy Gross, Bjorn Andersson
  Cc: dri-devel, linux-fbdev, kernel, AngeloGioacchino Del Regno,
	linux-arm-kernel, linux-mediatek, linux-pwm, Konrad Dybcio,
	linux-arm-msm

Hello,

this patch series adapts the platform drivers below drivers/video/backlight to
use the .remove_new() callback. Compared to the traditional .remove() callback
.remove_new() returns no value. This is a good thing because the driver core
doesn't (and cannot) cope for errors during remove. The only effect of a
non-zero return value in .remove() is that the driver core emits a warning. The
device is removed anyhow and an early return from .remove() usually yields a
resource leak.

By changing the remove callback to return void driver authors cannot
reasonably assume any more that there is some kind of cleanup later.

All drivers in drivers/video/backlight returned zero unconditionally in their
remove callback, so they could all be converted trivially to .remove_new().

Note that this series depends on commit 5c5a7680e67b ("platform: Provide
a remove callback that returns no value") which is included in v6.3-rc1.

Best regards
Uwe

Uwe Kleine-König (13):
  backlight: aat2870_bl: Convert to platform remove callback returning
    void
  backlight: adp5520_bl: Convert to platform remove callback returning
    void
  backlight: cr_bllcd: Convert to platform remove callback returning
    void
  backlight: da9052_bl: Convert to platform remove callback returning
    void
  backlight: hp680_bl: Convert to platform remove callback returning
    void
  backlight: led_bl: Convert to platform remove callback returning void
  backlight: lm3533_bl: Convert to platform remove callback returning
    void
  backlight: lp8788_bl: Convert to platform remove callback returning
    void
  backlight: mt6370-backlight: Convert to platform remove callback
    returning void
  backlight: pwm_bl: Convert to platform remove callback returning void
  backlight: qcom-wled: Convert to platform remove callback returning
    void
  backlight: rt4831-backlight: Convert to platform remove callback
    returning void
  backlight: sky81452-backlight: Convert to platform remove callback
    returning void

 drivers/video/backlight/aat2870_bl.c         | 6 ++----
 drivers/video/backlight/adp5520_bl.c         | 6 ++----
 drivers/video/backlight/cr_bllcd.c           | 6 ++----
 drivers/video/backlight/da9052_bl.c          | 6 ++----
 drivers/video/backlight/hp680_bl.c           | 6 ++----
 drivers/video/backlight/led_bl.c             | 6 ++----
 drivers/video/backlight/lm3533_bl.c          | 6 ++----
 drivers/video/backlight/lp8788_bl.c          | 6 ++----
 drivers/video/backlight/mt6370-backlight.c   | 6 ++----
 drivers/video/backlight/pwm_bl.c             | 6 ++----
 drivers/video/backlight/qcom-wled.c          | 6 ++----
 drivers/video/backlight/rt4831-backlight.c   | 6 ++----
 drivers/video/backlight/sky81452-backlight.c | 6 ++----
 13 files changed, 26 insertions(+), 52 deletions(-)

base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
-- 
2.39.1

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

* [PATCH 01/13] backlight: aat2870_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:47   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 02/13] backlight: adp5520_bl: " Uwe Kleine-König
                   ` (12 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/aat2870_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c
index 1cbb303e9c88..81fde3abb92c 100644
--- a/drivers/video/backlight/aat2870_bl.c
+++ b/drivers/video/backlight/aat2870_bl.c
@@ -178,7 +178,7 @@ static int aat2870_bl_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int aat2870_bl_remove(struct platform_device *pdev)
+static void aat2870_bl_remove(struct platform_device *pdev)
 {
 	struct aat2870_bl_driver_data *aat2870_bl = platform_get_drvdata(pdev);
 	struct backlight_device *bd = aat2870_bl->bd;
@@ -186,8 +186,6 @@ static int aat2870_bl_remove(struct platform_device *pdev)
 	bd->props.power = FB_BLANK_POWERDOWN;
 	bd->props.brightness = 0;
 	backlight_update_status(bd);
-
-	return 0;
 }
 
 static struct platform_driver aat2870_bl_driver = {
@@ -195,7 +193,7 @@ static struct platform_driver aat2870_bl_driver = {
 		.name	= "aat2870-backlight",
 	},
 	.probe		= aat2870_bl_probe,
-	.remove		= aat2870_bl_remove,
+	.remove_new	= aat2870_bl_remove,
 };
 
 static int __init aat2870_bl_init(void)
-- 
2.39.1


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

* [PATCH 02/13] backlight: adp5520_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-08  7:39 ` [PATCH 01/13] backlight: aat2870_bl: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-08  7:45   ` Hennerich, Michael
  2023-03-16 13:47   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 03/13] backlight: cr_bllcd: " Uwe Kleine-König
                   ` (11 subsequent siblings)
  13 siblings, 2 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Michael Hennerich, Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/adp5520_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c
index 686988c3df3a..8e0e9cfe5fe9 100644
--- a/drivers/video/backlight/adp5520_bl.c
+++ b/drivers/video/backlight/adp5520_bl.c
@@ -337,7 +337,7 @@ static int adp5520_bl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int adp5520_bl_remove(struct platform_device *pdev)
+static void adp5520_bl_remove(struct platform_device *pdev)
 {
 	struct backlight_device *bl = platform_get_drvdata(pdev);
 	struct adp5520_bl *data = bl_get_data(bl);
@@ -347,8 +347,6 @@ static int adp5520_bl_remove(struct platform_device *pdev)
 	if (data->pdata->en_ambl_sens)
 		sysfs_remove_group(&bl->dev.kobj,
 				&adp5520_bl_attr_group);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -377,7 +375,7 @@ static struct platform_driver adp5520_bl_driver = {
 		.pm	= &adp5520_bl_pm_ops,
 	},
 	.probe		= adp5520_bl_probe,
-	.remove		= adp5520_bl_remove,
+	.remove_new	= adp5520_bl_remove,
 };
 
 module_platform_driver(adp5520_bl_driver);
-- 
2.39.1


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

* [PATCH 03/13] backlight: cr_bllcd: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
  2023-03-08  7:39 ` [PATCH 01/13] backlight: aat2870_bl: " Uwe Kleine-König
  2023-03-08  7:39 ` [PATCH 02/13] backlight: adp5520_bl: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:48   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 04/13] backlight: da9052_bl: " Uwe Kleine-König
                   ` (10 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/cr_bllcd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c
index 4ad0a72531fe..781aeecc451d 100644
--- a/drivers/video/backlight/cr_bllcd.c
+++ b/drivers/video/backlight/cr_bllcd.c
@@ -210,7 +210,7 @@ static int cr_backlight_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int cr_backlight_remove(struct platform_device *pdev)
+static void cr_backlight_remove(struct platform_device *pdev)
 {
 	struct cr_panel *crp = platform_get_drvdata(pdev);
 
@@ -220,13 +220,11 @@ static int cr_backlight_remove(struct platform_device *pdev)
 	cr_backlight_set_intensity(crp->cr_backlight_device);
 	cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_POWERDOWN);
 	pci_dev_put(lpc_dev);
-
-	return 0;
 }
 
 static struct platform_driver cr_backlight_driver = {
 	.probe = cr_backlight_probe,
-	.remove = cr_backlight_remove,
+	.remove_new = cr_backlight_remove,
 	.driver = {
 		   .name = "cr_backlight",
 		   },
-- 
2.39.1


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

* [PATCH 04/13] backlight: da9052_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 03/13] backlight: cr_bllcd: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-08  9:23   ` DLG Adam Ward
  2023-03-16 13:48   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 05/13] backlight: hp680_bl: " Uwe Kleine-König
                   ` (9 subsequent siblings)
  13 siblings, 2 replies; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Support Opensource, Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/da9052_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c
index 882359dd288c..1cdc8543310b 100644
--- a/drivers/video/backlight/da9052_bl.c
+++ b/drivers/video/backlight/da9052_bl.c
@@ -135,7 +135,7 @@ static int da9052_backlight_probe(struct platform_device *pdev)
 	return da9052_adjust_wled_brightness(wleds);
 }
 
-static int da9052_backlight_remove(struct platform_device *pdev)
+static void da9052_backlight_remove(struct platform_device *pdev)
 {
 	struct backlight_device *bl = platform_get_drvdata(pdev);
 	struct da9052_bl *wleds = bl_get_data(bl);
@@ -143,8 +143,6 @@ static int da9052_backlight_remove(struct platform_device *pdev)
 	wleds->brightness = 0;
 	wleds->state = DA9052_WLEDS_OFF;
 	da9052_adjust_wled_brightness(wleds);
-
-	return 0;
 }
 
 static const struct platform_device_id da9052_wled_ids[] = {
@@ -166,7 +164,7 @@ MODULE_DEVICE_TABLE(platform, da9052_wled_ids);
 
 static struct platform_driver da9052_wled_driver = {
 	.probe		= da9052_backlight_probe,
-	.remove		= da9052_backlight_remove,
+	.remove_new	= da9052_backlight_remove,
 	.id_table	= da9052_wled_ids,
 	.driver	= {
 		.name	= "da9052-wled",
-- 
2.39.1


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

* [PATCH 05/13] backlight: hp680_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 04/13] backlight: da9052_bl: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:49   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 06/13] backlight: led_bl: " Uwe Kleine-König
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/hp680_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c
index 9123c33def05..ddb7ab4df77e 100644
--- a/drivers/video/backlight/hp680_bl.c
+++ b/drivers/video/backlight/hp680_bl.c
@@ -119,20 +119,18 @@ static int hp680bl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int hp680bl_remove(struct platform_device *pdev)
+static void hp680bl_remove(struct platform_device *pdev)
 {
 	struct backlight_device *bd = platform_get_drvdata(pdev);
 
 	bd->props.brightness = 0;
 	bd->props.power = 0;
 	hp680bl_send_intensity(bd);
-
-	return 0;
 }
 
 static struct platform_driver hp680bl_driver = {
 	.probe		= hp680bl_probe,
-	.remove		= hp680bl_remove,
+	.remove_new	= hp680bl_remove,
 	.driver		= {
 		.name	= "hp680-bl",
 		.pm	= &hp680bl_pm_ops,
-- 
2.39.1


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

* [PATCH 06/13] backlight: led_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (4 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 05/13] backlight: hp680_bl: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:49   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 07/13] backlight: lm3533_bl: " Uwe Kleine-König
                   ` (7 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/led_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/led_bl.c b/drivers/video/backlight/led_bl.c
index f54d256e2d54..a1b6a2ad73a0 100644
--- a/drivers/video/backlight/led_bl.c
+++ b/drivers/video/backlight/led_bl.c
@@ -217,7 +217,7 @@ static int led_bl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int led_bl_remove(struct platform_device *pdev)
+static void led_bl_remove(struct platform_device *pdev)
 {
 	struct led_bl_data *priv = platform_get_drvdata(pdev);
 	struct backlight_device *bl = priv->bl_dev;
@@ -228,8 +228,6 @@ static int led_bl_remove(struct platform_device *pdev)
 	led_bl_power_off(priv);
 	for (i = 0; i < priv->nb_leds; i++)
 		led_sysfs_enable(priv->leds[i]);
-
-	return 0;
 }
 
 static const struct of_device_id led_bl_of_match[] = {
@@ -245,7 +243,7 @@ static struct platform_driver led_bl_driver = {
 		.of_match_table	= of_match_ptr(led_bl_of_match),
 	},
 	.probe		= led_bl_probe,
-	.remove		= led_bl_remove,
+	.remove_new	= led_bl_remove,
 };
 
 module_platform_driver(led_bl_driver);
-- 
2.39.1


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

* [PATCH 07/13] backlight: lm3533_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (5 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 06/13] backlight: led_bl: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:50   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 08/13] backlight: lp8788_bl: " Uwe Kleine-König
                   ` (6 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/lm3533_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/lm3533_bl.c b/drivers/video/backlight/lm3533_bl.c
index 1df1b6643c0b..3e10d480cb7f 100644
--- a/drivers/video/backlight/lm3533_bl.c
+++ b/drivers/video/backlight/lm3533_bl.c
@@ -337,7 +337,7 @@ static int lm3533_bl_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int lm3533_bl_remove(struct platform_device *pdev)
+static void lm3533_bl_remove(struct platform_device *pdev)
 {
 	struct lm3533_bl *bl = platform_get_drvdata(pdev);
 	struct backlight_device *bd = bl->bd;
@@ -349,8 +349,6 @@ static int lm3533_bl_remove(struct platform_device *pdev)
 
 	lm3533_ctrlbank_disable(&bl->cb);
 	sysfs_remove_group(&bd->dev.kobj, &lm3533_bl_attribute_group);
-
-	return 0;
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -390,7 +388,7 @@ static struct platform_driver lm3533_bl_driver = {
 		.pm	= &lm3533_bl_pm_ops,
 	},
 	.probe		= lm3533_bl_probe,
-	.remove		= lm3533_bl_remove,
+	.remove_new	= lm3533_bl_remove,
 	.shutdown	= lm3533_bl_shutdown,
 };
 module_platform_driver(lm3533_bl_driver);
-- 
2.39.1


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

* [PATCH 08/13] backlight: lp8788_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (6 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 07/13] backlight: lm3533_bl: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:50   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 09/13] backlight: mt6370-backlight: " Uwe Kleine-König
                   ` (5 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/lp8788_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/lp8788_bl.c b/drivers/video/backlight/lp8788_bl.c
index ba42f3fe0c73..d1a14b0db265 100644
--- a/drivers/video/backlight/lp8788_bl.c
+++ b/drivers/video/backlight/lp8788_bl.c
@@ -298,7 +298,7 @@ static int lp8788_backlight_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int lp8788_backlight_remove(struct platform_device *pdev)
+static void lp8788_backlight_remove(struct platform_device *pdev)
 {
 	struct lp8788_bl *bl = platform_get_drvdata(pdev);
 	struct backlight_device *bl_dev = bl->bl_dev;
@@ -307,13 +307,11 @@ static int lp8788_backlight_remove(struct platform_device *pdev)
 	backlight_update_status(bl_dev);
 	sysfs_remove_group(&pdev->dev.kobj, &lp8788_attr_group);
 	lp8788_backlight_unregister(bl);
-
-	return 0;
 }
 
 static struct platform_driver lp8788_bl_driver = {
 	.probe = lp8788_backlight_probe,
-	.remove = lp8788_backlight_remove,
+	.remove_new = lp8788_backlight_remove,
 	.driver = {
 		.name = LP8788_DEV_BACKLIGHT,
 	},
-- 
2.39.1


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

* [PATCH 09/13] backlight: mt6370-backlight: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (7 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 08/13] backlight: lp8788_bl: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:50   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 10/13] backlight: pwm_bl: " Uwe Kleine-König
                   ` (4 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller, Matthias Brugger
  Cc: AngeloGioacchino Del Regno, dri-devel, linux-fbdev, kernel,
	linux-arm-kernel, linux-mediatek

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/mt6370-backlight.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/mt6370-backlight.c b/drivers/video/backlight/mt6370-backlight.c
index 623d4f2baca2..94422c956453 100644
--- a/drivers/video/backlight/mt6370-backlight.c
+++ b/drivers/video/backlight/mt6370-backlight.c
@@ -318,15 +318,13 @@ static int mt6370_bl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int mt6370_bl_remove(struct platform_device *pdev)
+static void mt6370_bl_remove(struct platform_device *pdev)
 {
 	struct mt6370_priv *priv = platform_get_drvdata(pdev);
 	struct backlight_device *bl_dev = priv->bl;
 
 	bl_dev->props.brightness = 0;
 	backlight_update_status(priv->bl);
-
-	return 0;
 }
 
 static const struct of_device_id mt6370_bl_of_match[] = {
@@ -342,7 +340,7 @@ static struct platform_driver mt6370_bl_driver = {
 		.of_match_table = mt6370_bl_of_match,
 	},
 	.probe = mt6370_bl_probe,
-	.remove = mt6370_bl_remove,
+	.remove_new = mt6370_bl_remove,
 };
 module_platform_driver(mt6370_bl_driver);
 
-- 
2.39.1


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

* [PATCH 10/13] backlight: pwm_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (8 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 09/13] backlight: mt6370-backlight: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:51   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 11/13] backlight: qcom-wled: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Thierry Reding, Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: linux-pwm, dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/pwm_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index fb388148d98f..fce412234d10 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -625,7 +625,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int pwm_backlight_remove(struct platform_device *pdev)
+static void pwm_backlight_remove(struct platform_device *pdev)
 {
 	struct backlight_device *bl = platform_get_drvdata(pdev);
 	struct pwm_bl_data *pb = bl_get_data(bl);
@@ -635,8 +635,6 @@ static int pwm_backlight_remove(struct platform_device *pdev)
 
 	if (pb->exit)
 		pb->exit(&pdev->dev);
-
-	return 0;
 }
 
 static void pwm_backlight_shutdown(struct platform_device *pdev)
@@ -690,7 +688,7 @@ static struct platform_driver pwm_backlight_driver = {
 		.of_match_table	= of_match_ptr(pwm_backlight_of_match),
 	},
 	.probe		= pwm_backlight_probe,
-	.remove		= pwm_backlight_remove,
+	.remove_new	= pwm_backlight_remove,
 	.shutdown	= pwm_backlight_shutdown,
 };
 
-- 
2.39.1


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

* [PATCH 11/13] backlight: qcom-wled: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (9 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 10/13] backlight: pwm_bl: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:51   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 12/13] backlight: rt4831-backlight: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Lee Jones, Daniel Thompson,
	Jingoo Han, Helge Deller
  Cc: Konrad Dybcio, linux-arm-msm, dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/qcom-wled.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c
index 527210e85795..8d88f36d8ff3 100644
--- a/drivers/video/backlight/qcom-wled.c
+++ b/drivers/video/backlight/qcom-wled.c
@@ -1717,7 +1717,7 @@ static int wled_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(bl);
 };
 
-static int wled_remove(struct platform_device *pdev)
+static void wled_remove(struct platform_device *pdev)
 {
 	struct wled *wled = platform_get_drvdata(pdev);
 
@@ -1725,8 +1725,6 @@ static int wled_remove(struct platform_device *pdev)
 	cancel_delayed_work_sync(&wled->ovp_work);
 	disable_irq(wled->short_irq);
 	disable_irq(wled->ovp_irq);
-
-	return 0;
 }
 
 static const struct of_device_id wled_match_table[] = {
@@ -1742,7 +1740,7 @@ MODULE_DEVICE_TABLE(of, wled_match_table);
 
 static struct platform_driver wled_driver = {
 	.probe = wled_probe,
-	.remove = wled_remove,
+	.remove_new = wled_remove,
 	.driver	= {
 		.name = "qcom,wled",
 		.of_match_table	= wled_match_table,
-- 
2.39.1


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

* [PATCH 12/13] backlight: rt4831-backlight: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (10 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 11/13] backlight: qcom-wled: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:51   ` Lee Jones
  2023-03-08  7:39 ` [PATCH 13/13] backlight: sky81452-backlight: " Uwe Kleine-König
  2023-03-08 12:04 ` [PATCH 00/13] backlight: " Daniel Thompson
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/rt4831-backlight.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/rt4831-backlight.c b/drivers/video/backlight/rt4831-backlight.c
index eb8c59e8713f..7d1af4c2ca67 100644
--- a/drivers/video/backlight/rt4831-backlight.c
+++ b/drivers/video/backlight/rt4831-backlight.c
@@ -203,15 +203,13 @@ static int rt4831_bl_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int rt4831_bl_remove(struct platform_device *pdev)
+static void rt4831_bl_remove(struct platform_device *pdev)
 {
 	struct rt4831_priv *priv = platform_get_drvdata(pdev);
 	struct backlight_device *bl_dev = priv->bl;
 
 	bl_dev->props.brightness = 0;
 	backlight_update_status(priv->bl);
-
-	return 0;
 }
 
 static const struct of_device_id __maybe_unused rt4831_bl_of_match[] = {
@@ -226,7 +224,7 @@ static struct platform_driver rt4831_bl_driver = {
 		.of_match_table = rt4831_bl_of_match,
 	},
 	.probe = rt4831_bl_probe,
-	.remove = rt4831_bl_remove,
+	.remove_new = rt4831_bl_remove,
 };
 module_platform_driver(rt4831_bl_driver);
 
-- 
2.39.1


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

* [PATCH 13/13] backlight: sky81452-backlight: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (11 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 12/13] backlight: rt4831-backlight: " Uwe Kleine-König
@ 2023-03-08  7:39 ` Uwe Kleine-König
  2023-03-16 13:52   ` Lee Jones
  2023-03-08 12:04 ` [PATCH 00/13] backlight: " Daniel Thompson
  13 siblings, 1 reply; 30+ messages in thread
From: Uwe Kleine-König @ 2023-03-08  7:39 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

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

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/video/backlight/sky81452-backlight.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c
index 0172438c38ce..eb18c6eb0ff0 100644
--- a/drivers/video/backlight/sky81452-backlight.c
+++ b/drivers/video/backlight/sky81452-backlight.c
@@ -311,7 +311,7 @@ static int sky81452_bl_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int sky81452_bl_remove(struct platform_device *pdev)
+static void sky81452_bl_remove(struct platform_device *pdev)
 {
 	const struct sky81452_bl_platform_data *pdata =
 						dev_get_platdata(&pdev->dev);
@@ -325,8 +325,6 @@ static int sky81452_bl_remove(struct platform_device *pdev)
 
 	if (pdata->gpiod_enable)
 		gpiod_set_value_cansleep(pdata->gpiod_enable, 0);
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
@@ -343,7 +341,7 @@ static struct platform_driver sky81452_bl_driver = {
 		.of_match_table = of_match_ptr(sky81452_bl_of_match),
 	},
 	.probe = sky81452_bl_probe,
-	.remove = sky81452_bl_remove,
+	.remove_new = sky81452_bl_remove,
 };
 
 module_platform_driver(sky81452_bl_driver);
-- 
2.39.1


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

* RE: [PATCH 02/13] backlight: adp5520_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 02/13] backlight: adp5520_bl: " Uwe Kleine-König
@ 2023-03-08  7:45   ` Hennerich, Michael
  2023-03-16 13:47   ` Lee Jones
  1 sibling, 0 replies; 30+ messages in thread
From: Hennerich, Michael @ 2023-03-08  7:45 UTC (permalink / raw)
  To: Uwe Kleine-König, Lee Jones, Daniel Thompson, Jingoo Han,
	Helge Deller
  Cc: dri-devel, linux-fbdev, kernel



> -----Original Message-----
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Sent: Mittwoch, 8. März 2023 08:40
> To: Hennerich, Michael <Michael.Hennerich@analog.com>; Lee Jones
> <lee@kernel.org>; Daniel Thompson <daniel.thompson@linaro.org>; Jingoo
> Han <jingoohan1@gmail.com>; Helge Deller <deller@gmx.de>
> Cc: dri-devel@lists.freedesktop.org; linux-fbdev@vger.kernel.org;
> kernel@pengutronix.de
> Subject: [PATCH 02/13] backlight: adp5520_bl: Convert to platform remove
> callback returning void
> 
> The .remove() callback for a platform driver returns an int which makes many
> driver authors wrongly assume it's possible to do error handling by returning
> an error code. However the value returned is (mostly) ignored and this
> typically results in resource leaks. To improve here there is a quest to make
> the remove callback return void. In the first step of this quest all drivers are
> converted to .remove_new() which already returns void.
> 
> Trivially convert this driver from always returning zero in the remove callback
> to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Acked-by: Michael Hennerich <michael.hennerich@analog.com>

> ---
>  drivers/video/backlight/adp5520_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/video/backlight/adp5520_bl.c
> b/drivers/video/backlight/adp5520_bl.c
> index 686988c3df3a..8e0e9cfe5fe9 100644
> --- a/drivers/video/backlight/adp5520_bl.c
> +++ b/drivers/video/backlight/adp5520_bl.c
> @@ -337,7 +337,7 @@ static int adp5520_bl_probe(struct platform_device
> *pdev)
>  	return 0;
>  }
> 
> -static int adp5520_bl_remove(struct platform_device *pdev)
> +static void adp5520_bl_remove(struct platform_device *pdev)
>  {
>  	struct backlight_device *bl = platform_get_drvdata(pdev);
>  	struct adp5520_bl *data = bl_get_data(bl); @@ -347,8 +347,6 @@
> static int adp5520_bl_remove(struct platform_device *pdev)
>  	if (data->pdata->en_ambl_sens)
>  		sysfs_remove_group(&bl->dev.kobj,
>  				&adp5520_bl_attr_group);
> -
> -	return 0;
>  }
> 
>  #ifdef CONFIG_PM_SLEEP
> @@ -377,7 +375,7 @@ static struct platform_driver adp5520_bl_driver = {
>  		.pm	= &adp5520_bl_pm_ops,
>  	},
>  	.probe		= adp5520_bl_probe,
> -	.remove		= adp5520_bl_remove,
> +	.remove_new	= adp5520_bl_remove,
>  };
> 
>  module_platform_driver(adp5520_bl_driver);
> --
> 2.39.1


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

* RE: [PATCH 04/13] backlight: da9052_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 04/13] backlight: da9052_bl: " Uwe Kleine-König
@ 2023-03-08  9:23   ` DLG Adam Ward
  2023-03-16 13:48   ` Lee Jones
  1 sibling, 0 replies; 30+ messages in thread
From: DLG Adam Ward @ 2023-03-08  9:23 UTC (permalink / raw)
  To: Uwe Kleine-König, Support Opensource, Lee Jones,
	Daniel Thompson, Jingoo Han, Helge Deller
  Cc: dri-devel, linux-fbdev, kernel

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

Acked-by: Adam Ward <DLG-Adam.Ward.opensource@dm.renesas.com>


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

* Re: [PATCH 00/13] backlight: Convert to platform remove callback returning void
  2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (12 preceding siblings ...)
  2023-03-08  7:39 ` [PATCH 13/13] backlight: sky81452-backlight: " Uwe Kleine-König
@ 2023-03-08 12:04 ` Daniel Thompson
  13 siblings, 0 replies; 30+ messages in thread
From: Daniel Thompson @ 2023-03-08 12:04 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Lee Jones, Jingoo Han, Helge Deller, Michael Hennerich,
	Support Opensource, Matthias Brugger, Thierry Reding, Andy Gross,
	Bjorn Andersson, dri-devel, linux-fbdev, kernel,
	AngeloGioacchino Del Regno, linux-arm-kernel, linux-mediatek,
	linux-pwm, Konrad Dybcio, linux-arm-msm

On Wed, Mar 08, 2023 at 08:39:32AM +0100, Uwe Kleine-König wrote:
> Uwe Kleine-König (13):
>   backlight: aat2870_bl: Convert to platform remove callback returning
>     void
>   backlight: adp5520_bl: Convert to platform remove callback returning
>     void
>   backlight: cr_bllcd: Convert to platform remove callback returning
>     void
>   backlight: da9052_bl: Convert to platform remove callback returning
>     void
>   backlight: hp680_bl: Convert to platform remove callback returning
>     void
>   backlight: led_bl: Convert to platform remove callback returning void
>   backlight: lm3533_bl: Convert to platform remove callback returning
>     void
>   backlight: lp8788_bl: Convert to platform remove callback returning
>     void
>   backlight: mt6370-backlight: Convert to platform remove callback
>     returning void
>   backlight: pwm_bl: Convert to platform remove callback returning void
>   backlight: qcom-wled: Convert to platform remove callback returning
>     void
>   backlight: rt4831-backlight: Convert to platform remove callback
>     returning void
>   backlight: sky81452-backlight: Convert to platform remove callback
>     returning void

Whole series is:
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>


Thanks!

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

* Re: [PATCH 01/13] backlight: aat2870_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 01/13] backlight: aat2870_bl: " Uwe Kleine-König
@ 2023-03-16 13:47   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/aat2870_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 02/13] backlight: adp5520_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 02/13] backlight: adp5520_bl: " Uwe Kleine-König
  2023-03-08  7:45   ` Hennerich, Michael
@ 2023-03-16 13:47   ` Lee Jones
  1 sibling, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Michael Hennerich, Daniel Thompson, Jingoo Han, Helge Deller,
	dri-devel, linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/adp5520_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 03/13] backlight: cr_bllcd: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 03/13] backlight: cr_bllcd: " Uwe Kleine-König
@ 2023-03-16 13:48   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:48 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/cr_bllcd.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 04/13] backlight: da9052_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 04/13] backlight: da9052_bl: " Uwe Kleine-König
  2023-03-08  9:23   ` DLG Adam Ward
@ 2023-03-16 13:48   ` Lee Jones
  1 sibling, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:48 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Support Opensource, Daniel Thompson, Jingoo Han, Helge Deller,
	dri-devel, linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/da9052_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 05/13] backlight: hp680_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 05/13] backlight: hp680_bl: " Uwe Kleine-König
@ 2023-03-16 13:49   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:49 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/hp680_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 06/13] backlight: led_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 06/13] backlight: led_bl: " Uwe Kleine-König
@ 2023-03-16 13:49   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:49 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/led_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 07/13] backlight: lm3533_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 07/13] backlight: lm3533_bl: " Uwe Kleine-König
@ 2023-03-16 13:50   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:50 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/lm3533_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 08/13] backlight: lp8788_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 08/13] backlight: lp8788_bl: " Uwe Kleine-König
@ 2023-03-16 13:50   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:50 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/lp8788_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 09/13] backlight: mt6370-backlight: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 09/13] backlight: mt6370-backlight: " Uwe Kleine-König
@ 2023-03-16 13:50   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:50 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, Matthias Brugger,
	AngeloGioacchino Del Regno, dri-devel, linux-fbdev, kernel,
	linux-arm-kernel, linux-mediatek

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/mt6370-backlight.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 10/13] backlight: pwm_bl: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 10/13] backlight: pwm_bl: " Uwe Kleine-König
@ 2023-03-16 13:51   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:51 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Thierry Reding, Daniel Thompson, Jingoo Han, Helge Deller,
	linux-pwm, dri-devel, linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/pwm_bl.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 11/13] backlight: qcom-wled: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 11/13] backlight: qcom-wled: " Uwe Kleine-König
@ 2023-03-16 13:51   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:51 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Andy Gross, Bjorn Andersson, Daniel Thompson, Jingoo Han,
	Helge Deller, Konrad Dybcio, linux-arm-msm, dri-devel,
	linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/qcom-wled.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 12/13] backlight: rt4831-backlight: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 12/13] backlight: rt4831-backlight: " Uwe Kleine-König
@ 2023-03-16 13:51   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:51 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/rt4831-backlight.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

* Re: [PATCH 13/13] backlight: sky81452-backlight: Convert to platform remove callback returning void
  2023-03-08  7:39 ` [PATCH 13/13] backlight: sky81452-backlight: " Uwe Kleine-König
@ 2023-03-16 13:52   ` Lee Jones
  0 siblings, 0 replies; 30+ messages in thread
From: Lee Jones @ 2023-03-16 13:52 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Daniel Thompson, Jingoo Han, Helge Deller, dri-devel,
	linux-fbdev, kernel

On Wed, 08 Mar 2023, 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 (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
>
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/video/backlight/sky81452-backlight.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

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

end of thread, other threads:[~2023-03-16 13:52 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08  7:39 [PATCH 00/13] backlight: Convert to platform remove callback returning void Uwe Kleine-König
2023-03-08  7:39 ` [PATCH 01/13] backlight: aat2870_bl: " Uwe Kleine-König
2023-03-16 13:47   ` Lee Jones
2023-03-08  7:39 ` [PATCH 02/13] backlight: adp5520_bl: " Uwe Kleine-König
2023-03-08  7:45   ` Hennerich, Michael
2023-03-16 13:47   ` Lee Jones
2023-03-08  7:39 ` [PATCH 03/13] backlight: cr_bllcd: " Uwe Kleine-König
2023-03-16 13:48   ` Lee Jones
2023-03-08  7:39 ` [PATCH 04/13] backlight: da9052_bl: " Uwe Kleine-König
2023-03-08  9:23   ` DLG Adam Ward
2023-03-16 13:48   ` Lee Jones
2023-03-08  7:39 ` [PATCH 05/13] backlight: hp680_bl: " Uwe Kleine-König
2023-03-16 13:49   ` Lee Jones
2023-03-08  7:39 ` [PATCH 06/13] backlight: led_bl: " Uwe Kleine-König
2023-03-16 13:49   ` Lee Jones
2023-03-08  7:39 ` [PATCH 07/13] backlight: lm3533_bl: " Uwe Kleine-König
2023-03-16 13:50   ` Lee Jones
2023-03-08  7:39 ` [PATCH 08/13] backlight: lp8788_bl: " Uwe Kleine-König
2023-03-16 13:50   ` Lee Jones
2023-03-08  7:39 ` [PATCH 09/13] backlight: mt6370-backlight: " Uwe Kleine-König
2023-03-16 13:50   ` Lee Jones
2023-03-08  7:39 ` [PATCH 10/13] backlight: pwm_bl: " Uwe Kleine-König
2023-03-16 13:51   ` Lee Jones
2023-03-08  7:39 ` [PATCH 11/13] backlight: qcom-wled: " Uwe Kleine-König
2023-03-16 13:51   ` Lee Jones
2023-03-08  7:39 ` [PATCH 12/13] backlight: rt4831-backlight: " Uwe Kleine-König
2023-03-16 13:51   ` Lee Jones
2023-03-08  7:39 ` [PATCH 13/13] backlight: sky81452-backlight: " Uwe Kleine-König
2023-03-16 13:52   ` Lee Jones
2023-03-08 12:04 ` [PATCH 00/13] backlight: " Daniel Thompson

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).