Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Uwe Kleine-König and committed by
Lee Jones
1c708d34 cba7dfe0

+2 -4
+2 -4
drivers/video/backlight/lp8788_bl.c
··· 298 298 return ret; 299 299 } 300 300 301 - static int lp8788_backlight_remove(struct platform_device *pdev) 301 + static void lp8788_backlight_remove(struct platform_device *pdev) 302 302 { 303 303 struct lp8788_bl *bl = platform_get_drvdata(pdev); 304 304 struct backlight_device *bl_dev = bl->bl_dev; ··· 307 307 backlight_update_status(bl_dev); 308 308 sysfs_remove_group(&pdev->dev.kobj, &lp8788_attr_group); 309 309 lp8788_backlight_unregister(bl); 310 - 311 - return 0; 312 310 } 313 311 314 312 static struct platform_driver lp8788_bl_driver = { 315 313 .probe = lp8788_backlight_probe, 316 - .remove = lp8788_backlight_remove, 314 + .remove_new = lp8788_backlight_remove, 317 315 .driver = { 318 316 .name = LP8788_DEV_BACKLIGHT, 319 317 },