]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
crypto: xilinx/zynqmp-aes-gcm - Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 20 Oct 2023 07:56:03 +0000 (09:56 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 27 Oct 2023 10:04:27 +0000 (18:04 +0800)
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: Michal Simek <michal.simek@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/xilinx/zynqmp-aes-gcm.c

index ce335578b759ed9531a35fe54b4e61bb16b8ca58..3c205324b22b676be150d44957c52d299fdd3a5d 100644 (file)
@@ -421,12 +421,10 @@ err_engine:
        return err;
 }
 
-static int zynqmp_aes_aead_remove(struct platform_device *pdev)
+static void zynqmp_aes_aead_remove(struct platform_device *pdev)
 {
        crypto_engine_exit(aes_drv_ctx.engine);
        crypto_engine_unregister_aead(&aes_drv_ctx.alg.aead);
-
-       return 0;
 }
 
 static const struct of_device_id zynqmp_aes_dt_ids[] = {
@@ -437,7 +435,7 @@ MODULE_DEVICE_TABLE(of, zynqmp_aes_dt_ids);
 
 static struct platform_driver zynqmp_aes_driver = {
        .probe  = zynqmp_aes_aead_probe,
-       .remove = zynqmp_aes_aead_remove,
+       .remove_new = zynqmp_aes_aead_remove,
        .driver = {
                .name           = "zynqmp-aes",
                .of_match_table = zynqmp_aes_dt_ids,