Skip to content

Commit 141adf2

Browse files
Uwe Kleine-Königmathieupoirier
authored andcommitted
remoteproc: 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 (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> Link: https://lore.kernel.org/r/20230504194453.1150368-8-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent da84267 commit 141adf2

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/remoteproc/omap_remoteproc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,15 +1363,13 @@ static int omap_rproc_probe(struct platform_device *pdev)
13631363
return ret;
13641364
}
13651365

1366-
static int omap_rproc_remove(struct platform_device *pdev)
1366+
static void omap_rproc_remove(struct platform_device *pdev)
13671367
{
13681368
struct rproc *rproc = platform_get_drvdata(pdev);
13691369

13701370
rproc_del(rproc);
13711371
rproc_free(rproc);
13721372
of_reserved_mem_device_release(&pdev->dev);
1373-
1374-
return 0;
13751373
}
13761374

13771375
static const struct dev_pm_ops omap_rproc_pm_ops = {
@@ -1382,7 +1380,7 @@ static const struct dev_pm_ops omap_rproc_pm_ops = {
13821380

13831381
static struct platform_driver omap_rproc_driver = {
13841382
.probe = omap_rproc_probe,
1385-
.remove = omap_rproc_remove,
1383+
.remove_new = omap_rproc_remove,
13861384
.driver = {
13871385
.name = "omap-rproc",
13881386
.pm = &omap_rproc_pm_ops,

0 commit comments

Comments
 (0)