Skip to content

Commit 021bc4b

Browse files
Uwe Kleine-Königardbiesheuvel
authored andcommitted
virt: efi_secret: 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 <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 9c55461 commit 021bc4b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/virt/coco/efi_secret/efi_secret.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,15 @@ static int efi_secret_probe(struct platform_device *dev)
326326
return ret;
327327
}
328328

329-
static int efi_secret_remove(struct platform_device *dev)
329+
static void efi_secret_remove(struct platform_device *dev)
330330
{
331331
efi_secret_securityfs_teardown(dev);
332332
efi_secret_unmap_area();
333-
return 0;
334333
}
335334

336335
static struct platform_driver efi_secret_driver = {
337336
.probe = efi_secret_probe,
338-
.remove = efi_secret_remove,
337+
.remove_new = efi_secret_remove,
339338
.driver = {
340339
.name = "efi_secret",
341340
},

0 commit comments

Comments
 (0)