Skip to content

Commit bf76544

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
fbdev: au1100fb: 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 <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 4369e38 commit bf76544

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/video/fbdev/au1100fb.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ static int au1100fb_drv_probe(struct platform_device *dev)
520520
return -ENODEV;
521521
}
522522

523-
int au1100fb_drv_remove(struct platform_device *dev)
523+
void au1100fb_drv_remove(struct platform_device *dev)
524524
{
525525
struct au1100fb_device *fbdev = NULL;
526526

@@ -540,8 +540,6 @@ int au1100fb_drv_remove(struct platform_device *dev)
540540
clk_disable_unprepare(fbdev->lcdclk);
541541
clk_put(fbdev->lcdclk);
542542
}
543-
544-
return 0;
545543
}
546544

547545
#ifdef CONFIG_PM
@@ -590,9 +588,9 @@ static struct platform_driver au1100fb_driver = {
590588
.name = "au1100-lcd",
591589
},
592590
.probe = au1100fb_drv_probe,
593-
.remove = au1100fb_drv_remove,
591+
.remove_new = au1100fb_drv_remove,
594592
.suspend = au1100fb_drv_suspend,
595-
.resume = au1100fb_drv_resume,
593+
.resume = au1100fb_drv_resume,
596594
};
597595
module_platform_driver(au1100fb_driver);
598596

0 commit comments

Comments
 (0)