Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 919e3ec

Browse files
Uwe Kleine-Königrichardweinberger
authored andcommitted
um: virtio_uml: 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> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Richard Weinberger <richard@nod.at>
1 parent 5aca325 commit 919e3ec

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/um/drivers/virtio_uml.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,12 +1241,11 @@ static int virtio_uml_probe(struct platform_device *pdev)
12411241
return rc;
12421242
}
12431243

1244-
static int virtio_uml_remove(struct platform_device *pdev)
1244+
static void virtio_uml_remove(struct platform_device *pdev)
12451245
{
12461246
struct virtio_uml_device *vu_dev = platform_get_drvdata(pdev);
12471247

12481248
unregister_virtio_device(&vu_dev->vdev);
1249-
return 0;
12501249
}
12511250

12521251
/* Command line device list */
@@ -1445,7 +1444,7 @@ static int virtio_uml_resume(struct platform_device *pdev)
14451444

14461445
static struct platform_driver virtio_uml_driver = {
14471446
.probe = virtio_uml_probe,
1448-
.remove = virtio_uml_remove,
1447+
.remove_new = virtio_uml_remove,
14491448
.driver = {
14501449
.name = "virtio-uml",
14511450
.of_match_table = virtio_uml_match,

0 commit comments

Comments
 (0)