Skip to content

Commit 1fd9927

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: tcx: 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 7b49f61 commit 1fd9927

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/video/fbdev/tcx.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static int tcx_probe(struct platform_device *op)
486486
return err;
487487
}
488488

489-
static int tcx_remove(struct platform_device *op)
489+
static void tcx_remove(struct platform_device *op)
490490
{
491491
struct fb_info *info = dev_get_drvdata(&op->dev);
492492
struct tcx_par *par = info->par;
@@ -497,8 +497,6 @@ static int tcx_remove(struct platform_device *op)
497497
tcx_unmap_regs(op, info, par);
498498

499499
framebuffer_release(info);
500-
501-
return 0;
502500
}
503501

504502
static const struct of_device_id tcx_match[] = {
@@ -515,7 +513,7 @@ static struct platform_driver tcx_driver = {
515513
.of_match_table = tcx_match,
516514
},
517515
.probe = tcx_probe,
518-
.remove = tcx_remove,
516+
.remove_new = tcx_remove,
519517
};
520518

521519
static int __init tcx_init(void)

0 commit comments

Comments
 (0)