Skip to content

Commit 3ab20cd

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: vt8500lcdfb: 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> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 87b1e9a commit 3ab20cd

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/video/fbdev/vt8500lcdfb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ static int vt8500lcd_probe(struct platform_device *pdev)
439439
return ret;
440440
}
441441

442-
static int vt8500lcd_remove(struct platform_device *pdev)
442+
static void vt8500lcd_remove(struct platform_device *pdev)
443443
{
444444
struct vt8500lcd_info *fbi = platform_get_drvdata(pdev);
445445
struct resource *res;
@@ -462,8 +462,6 @@ static int vt8500lcd_remove(struct platform_device *pdev)
462462

463463
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
464464
release_mem_region(res->start, resource_size(res));
465-
466-
return 0;
467465
}
468466

469467
static const struct of_device_id via_dt_ids[] = {
@@ -473,7 +471,7 @@ static const struct of_device_id via_dt_ids[] = {
473471

474472
static struct platform_driver vt8500lcd_driver = {
475473
.probe = vt8500lcd_probe,
476-
.remove = vt8500lcd_remove,
474+
.remove_new = vt8500lcd_remove,
477475
.driver = {
478476
.name = "vt8500-lcd",
479477
.of_match_table = of_match_ptr(via_dt_ids),

0 commit comments

Comments
 (0)