diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-03-08 08:39:35 +0100 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-03-16 15:08:35 +0000 |
commit | f6672d7f0cff6ee8bd09851545b60e41099197ae (patch) | |
tree | d901fb174f127fe2f32f995e554a31a5aa80663f /drivers/video/backlight | |
parent | 6879039167ff4b6805760f1c5935e93c92dc6aa4 (diff) |
backlight: cr_bllcd: 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-4-u.kleine-koenig@pengutronix.de
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/cr_bllcd.c | 6 |
1 files 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", }, |