Skip to content

Commit f6672d7

Browse files
Uwe Kleine-Königlag-linaro
authored andcommitted
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
1 parent 6879039 commit f6672d7

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/video/backlight/cr_bllcd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static int cr_backlight_probe(struct platform_device *pdev)
210210
return 0;
211211
}
212212

213-
static int cr_backlight_remove(struct platform_device *pdev)
213+
static void cr_backlight_remove(struct platform_device *pdev)
214214
{
215215
struct cr_panel *crp = platform_get_drvdata(pdev);
216216

@@ -220,13 +220,11 @@ static int cr_backlight_remove(struct platform_device *pdev)
220220
cr_backlight_set_intensity(crp->cr_backlight_device);
221221
cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_POWERDOWN);
222222
pci_dev_put(lpc_dev);
223-
224-
return 0;
225223
}
226224

227225
static struct platform_driver cr_backlight_driver = {
228226
.probe = cr_backlight_probe,
229-
.remove = cr_backlight_remove,
227+
.remove_new = cr_backlight_remove,
230228
.driver = {
231229
.name = "cr_backlight",
232230
},

0 commit comments

Comments
 (0)