Skip to contentSkip to conversation

backlight: Convert to platform remove callback returning void

PATCH Applied Uwe Kleine-König 5 participants 30 messages Mar 8, 2023 – Mar 16, 2023

Subsystems (7)
lore
Share & tools
lore
#0 lore raw

cover backlight: Convert to platform remove callback returning void

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

Signature · 1 line
2.39.1
#1 lore raw

PATCH 1/13 backlight: aat2870_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.

---
 drivers/video/backlight/aat2870_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/aat2870_bl.c +2 -4
index 1cbb303e9c88..81fde3abb92c 100644
@@ -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)
Signature · 1 line
2.39.1
maintainer Applied
#2 lore raw

Re: [PATCH 01/13] backlight: aat2870_bl: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/aat2870_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#3 lore raw

PATCH 2/13 backlight: adp5520_bl: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/adp5520_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/adp5520_bl.c +2 -4
index 686988c3df3a..8e0e9cfe5fe9 100644
@@ -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);
Signature · 1 line
2.39.1
maintainer Acked-by on v1 2/13
#4 lore raw

RE: [PATCH 02/13] backlight: adp5520_bl: Convert to platform remove callback returning void

Quoted 20 lines

-----Original Message-----
From: Uwe Kleine-König <[email protected]>
Sent: Mittwoch, 8. März 2023 08:40
To: Hennerich, Michael <[email protected]>; Lee Jones <[email protected]>; Daniel Thompson <[email protected]>; Jingoo Han <[email protected]>; Helge Deller <[email protected]>
Cc: [email protected]; [email protected]; [email protected]
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.

Quoted 4 lines

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

Quoted 39 lines
---
 drivers/video/backlight/adp5520_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/adp5520_bl.c +1 -1
index 686988c3df3a..8e0e9cfe5fe9 100644
@@ -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)

drivers/video/backlight/adp5520_bl.c +1 -4
 	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

maintainer Applied
#5 lore raw

Re: [PATCH 02/13] backlight: adp5520_bl: Convert to platform remove callback returning void

In reply to Uwe Kleine-König
Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/adp5520_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#6 lore raw

PATCH 3/13 backlight: cr_bllcd: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/cr_bllcd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/cr_bllcd.c +2 -4
index 4ad0a72531fe..781aeecc451d 100644
@@ -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",
 		   },
Signature · 1 line
2.39.1
maintainer Applied
#7 lore raw

Re: [PATCH 03/13] backlight: cr_bllcd: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/cr_bllcd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#8 lore raw

PATCH 4/13 backlight: da9052_bl: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/da9052_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/da9052_bl.c +2 -4
index 882359dd288c..1cdc8543310b 100644
@@ -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",
Signature · 1 line
2.39.1
Acked-by on v1 4/13
#9 lore raw

RE: [PATCH 04/13] backlight: da9052_bl: Convert to platform remove callback returning void

Quoted 5 lines · Uwe Kleine-König

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.

maintainer Applied
#10 lore raw

Re: [PATCH 04/13] backlight: da9052_bl: Convert to platform remove callback returning void

In reply to Uwe Kleine-König
Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/da9052_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#11 lore raw

PATCH 5/13 backlight: hp680_bl: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/hp680_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/hp680_bl.c +2 -4
index 9123c33def05..ddb7ab4df77e 100644
@@ -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,
Signature · 1 line
2.39.1
maintainer Applied
#12 lore raw

Re: [PATCH 05/13] backlight: hp680_bl: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/hp680_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#13 lore raw

PATCH 6/13 backlight: led_bl: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/led_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/led_bl.c +2 -4
index f54d256e2d54..a1b6a2ad73a0 100644
@@ -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);
Signature · 1 line
2.39.1
maintainer Applied
#14 lore raw

Re: [PATCH 06/13] backlight: led_bl: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/led_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#15 lore raw

PATCH 7/13 backlight: lm3533_bl: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/lm3533_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/lm3533_bl.c +2 -4
index 1df1b6643c0b..3e10d480cb7f 100644
@@ -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);
Signature · 1 line
2.39.1
maintainer Applied
#16 lore raw

Re: [PATCH 07/13] backlight: lm3533_bl: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/lm3533_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#17 lore raw

PATCH 8/13 backlight: lp8788_bl: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/lp8788_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/lp8788_bl.c +2 -4
index ba42f3fe0c73..d1a14b0db265 100644
@@ -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,
 	},
Signature · 1 line
2.39.1
maintainer Applied
#18 lore raw

Re: [PATCH 08/13] backlight: lp8788_bl: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/lp8788_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#19 lore raw

PATCH 9/13 backlight: mt6370-backlight: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/mt6370-backlight.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/mt6370-backlight.c +2 -4
index 623d4f2baca2..94422c956453 100644
@@ -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);
 
Signature · 1 line
2.39.1
maintainer Applied
#20 lore raw

Re: [PATCH 09/13] backlight: mt6370-backlight: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/mt6370-backlight.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#21 lore raw

PATCH 10/13 backlight: pwm_bl: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/pwm_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/pwm_bl.c +2 -4
index fb388148d98f..fce412234d10 100644
@@ -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,
 };
 
Signature · 1 line
2.39.1
maintainer Applied
#22 lore raw

Re: [PATCH 10/13] backlight: pwm_bl: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/pwm_bl.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#23 lore raw

PATCH 11/13 backlight: qcom-wled: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/qcom-wled.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/qcom-wled.c +2 -4
index 527210e85795..8d88f36d8ff3 100644
@@ -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,
Signature · 1 line
2.39.1
maintainer Applied
#24 lore raw

Re: [PATCH 11/13] backlight: qcom-wled: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/qcom-wled.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#25 lore raw

PATCH 12/13 backlight: rt4831-backlight: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/rt4831-backlight.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/rt4831-backlight.c +2 -4
index eb8c59e8713f..7d1af4c2ca67 100644
@@ -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);
 
Signature · 1 line
2.39.1
maintainer Applied
#26 lore raw

Re: [PATCH 12/13] backlight: rt4831-backlight: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/rt4831-backlight.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

#27 lore raw

PATCH 13/13 backlight: sky81452-backlight: Convert to platform remove callback returning void

In reply to Uwe Kleine-König

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.

---
 drivers/video/backlight/sky81452-backlight.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/video/backlight/sky81452-backlight.c +2 -4
index 0172438c38ce..eb18c6eb0ff0 100644
@@ -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);
Signature · 1 line
2.39.1
maintainer Applied
#28 lore raw

Re: [PATCH 13/13] backlight: sky81452-backlight: Convert to platform remove callback returning void

Quoted 8 lines · Uwe Kleine-König

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.

Quoted 7 lines

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

---
 drivers/video/backlight/sky81452-backlight.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

Reviewed-by on the v1 series
#29 lore raw
In reply to Uwe Kleine-König
Quoted 17 lines · Uwe Kleine-König

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

Quoted 8 lines

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:

Thanks!