Skip to content

Commit 94ea6ed

Browse files
Uwe Kleine-Königmathieupoirier
authored andcommitted
remoteproc: imx: 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> Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com> Link: https://lore.kernel.org/r/20230504194453.1150368-4-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent 31c1a5b commit 94ea6ed

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/remoteproc/imx_rproc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ static int imx_rproc_probe(struct platform_device *pdev)
11121112
return ret;
11131113
}
11141114

1115-
static int imx_rproc_remove(struct platform_device *pdev)
1115+
static void imx_rproc_remove(struct platform_device *pdev)
11161116
{
11171117
struct rproc *rproc = platform_get_drvdata(pdev);
11181118
struct imx_rproc *priv = rproc->priv;
@@ -1123,8 +1123,6 @@ static int imx_rproc_remove(struct platform_device *pdev)
11231123
imx_rproc_free_mbox(rproc);
11241124
destroy_workqueue(priv->workqueue);
11251125
rproc_free(rproc);
1126-
1127-
return 0;
11281126
}
11291127

11301128
static const struct of_device_id imx_rproc_of_match[] = {
@@ -1145,7 +1143,7 @@ MODULE_DEVICE_TABLE(of, imx_rproc_of_match);
11451143

11461144
static struct platform_driver imx_rproc_driver = {
11471145
.probe = imx_rproc_probe,
1148-
.remove = imx_rproc_remove,
1146+
.remove_new = imx_rproc_remove,
11491147
.driver = {
11501148
.name = "imx-rproc",
11511149
.of_match_table = imx_rproc_of_match,

0 commit comments

Comments
 (0)