Skip to content

Commit 7150f8c

Browse files
Uwe Kleine-Königlag-linaro
authored andcommitted
backlight: hp680_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> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee@kernel.org> Link: https://lore.kernel.org/r/20230308073945.2336302-6-u.kleine-koenig@pengutronix.de
1 parent 78a2bb4 commit 7150f8c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/video/backlight/hp680_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,18 @@ static int hp680bl_probe(struct platform_device *pdev)
119119
return 0;
120120
}
121121

122-
static int hp680bl_remove(struct platform_device *pdev)
122+
static void hp680bl_remove(struct platform_device *pdev)
123123
{
124124
struct backlight_device *bd = platform_get_drvdata(pdev);
125125

126126
bd->props.brightness = 0;
127127
bd->props.power = 0;
128128
hp680bl_send_intensity(bd);
129-
130-
return 0;
131129
}
132130

133131
static struct platform_driver hp680bl_driver = {
134132
.probe = hp680bl_probe,
135-
.remove = hp680bl_remove,
133+
.remove_new = hp680bl_remove,
136134
.driver = {
137135
.name = "hp680-bl",
138136
.pm = &hp680bl_pm_ops,

0 commit comments

Comments
 (0)