Skip to content

Commit ab572ab

Browse files
Uwe Kleine-KönigJassiBrar
authored andcommitted
mailbox: tegra-hsp: 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 b8e346b commit ab572ab

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/mailbox/tegra-hsp.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -868,13 +868,11 @@ static int tegra_hsp_probe(struct platform_device *pdev)
868868
return 0;
869869
}
870870

871-
static int tegra_hsp_remove(struct platform_device *pdev)
871+
static void tegra_hsp_remove(struct platform_device *pdev)
872872
{
873873
struct tegra_hsp *hsp = platform_get_drvdata(pdev);
874874

875875
lockdep_unregister_key(&hsp->lock_key);
876-
877-
return 0;
878876
}
879877

880878
static int __maybe_unused tegra_hsp_resume(struct device *dev)
@@ -953,7 +951,7 @@ static struct platform_driver tegra_hsp_driver = {
953951
.pm = &tegra_hsp_pm_ops,
954952
},
955953
.probe = tegra_hsp_probe,
956-
.remove = tegra_hsp_remove,
954+
.remove_new = tegra_hsp_remove,
957955
};
958956

959957
static int __init tegra_hsp_init(void)

0 commit comments

Comments
 (0)