Skip to content

Commit 1c708d3

Browse files
Uwe Kleine-Königlag-linaro
authored andcommitted
backlight: lp8788_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-9-u.kleine-koenig@pengutronix.de
1 parent cba7dfe commit 1c708d3

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/video/backlight/lp8788_bl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int lp8788_backlight_probe(struct platform_device *pdev)
298298
return ret;
299299
}
300300

301-
static int lp8788_backlight_remove(struct platform_device *pdev)
301+
static void lp8788_backlight_remove(struct platform_device *pdev)
302302
{
303303
struct lp8788_bl *bl = platform_get_drvdata(pdev);
304304
struct backlight_device *bl_dev = bl->bl_dev;
@@ -307,13 +307,11 @@ static int lp8788_backlight_remove(struct platform_device *pdev)
307307
backlight_update_status(bl_dev);
308308
sysfs_remove_group(&pdev->dev.kobj, &lp8788_attr_group);
309309
lp8788_backlight_unregister(bl);
310-
311-
return 0;
312310
}
313311

314312
static struct platform_driver lp8788_bl_driver = {
315313
.probe = lp8788_backlight_probe,
316-
.remove = lp8788_backlight_remove,
314+
.remove_new = lp8788_backlight_remove,
317315
.driver = {
318316
.name = LP8788_DEV_BACKLIGHT,
319317
},

0 commit comments

Comments
 (0)