Skip to content

Commit d1d8d44

Browse files
Uwe Kleine-Königmathieupoirier
authored andcommitted
remoteproc: virtio: 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-16-u.kleine-koenig@pengutronix.de Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
1 parent ed61187 commit d1d8d44

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/remoteproc/remoteproc_virtio.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ static int rproc_virtio_probe(struct platform_device *pdev)
569569
return ret;
570570
}
571571

572-
static int rproc_virtio_remove(struct platform_device *pdev)
572+
static void rproc_virtio_remove(struct platform_device *pdev)
573573
{
574574
struct rproc_vdev *rvdev = dev_get_drvdata(&pdev->dev);
575575
struct rproc *rproc = rvdev->rproc;
@@ -588,14 +588,12 @@ static int rproc_virtio_remove(struct platform_device *pdev)
588588
dma_release_coherent_memory(&pdev->dev);
589589

590590
put_device(&rproc->dev);
591-
592-
return 0;
593591
}
594592

595593
/* Platform driver */
596594
static struct platform_driver rproc_virtio_driver = {
597595
.probe = rproc_virtio_probe,
598-
.remove = rproc_virtio_remove,
596+
.remove_new = rproc_virtio_remove,
599597
.driver = {
600598
.name = "rproc-virtio",
601599
},

0 commit comments

Comments
 (0)