Skip to content

Commit 6778592

Browse files
Uwe Kleine-KönigJassiBrar
authored andcommitted
mailbox: omap: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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: Jassi Brar <jaswinder.singh@linaro.org>
1 parent e89c7c3 commit 6778592

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/mailbox/omap-mailbox.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -865,19 +865,17 @@ static int omap_mbox_probe(struct platform_device *pdev)
865865
return ret;
866866
}
867867

868-
static int omap_mbox_remove(struct platform_device *pdev)
868+
static void omap_mbox_remove(struct platform_device *pdev)
869869
{
870870
struct omap_mbox_device *mdev = platform_get_drvdata(pdev);
871871

872872
pm_runtime_disable(mdev->dev);
873873
omap_mbox_unregister(mdev);
874-
875-
return 0;
876874
}
877875

878876
static struct platform_driver omap_mbox_driver = {
879877
.probe = omap_mbox_probe,
880-
.remove = omap_mbox_remove,
878+
.remove_new = omap_mbox_remove,
881879
.driver = {
882880
.name = "omap-mailbox",
883881
.pm = &omap_mbox_pm_ops,

0 commit comments

Comments
 (0)