Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: axis/artpec6 - 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>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Uwe Kleine-König and committed by
Herbert Xu
a63e2236 5cc3e7bc

+2 -3
+2 -3
drivers/crypto/axis/artpec6_crypto.c
··· 2957 2957 return err; 2958 2958 } 2959 2959 2960 - static int artpec6_crypto_remove(struct platform_device *pdev) 2960 + static void artpec6_crypto_remove(struct platform_device *pdev) 2961 2961 { 2962 2962 struct artpec6_crypto *ac = platform_get_drvdata(pdev); 2963 2963 int irq = platform_get_irq(pdev, 0); ··· 2977 2977 #ifdef CONFIG_DEBUG_FS 2978 2978 artpec6_crypto_free_debugfs(); 2979 2979 #endif 2980 - return 0; 2981 2980 } 2982 2981 2983 2982 static struct platform_driver artpec6_crypto_driver = { 2984 2983 .probe = artpec6_crypto_probe, 2985 - .remove = artpec6_crypto_remove, 2984 + .remove_new = artpec6_crypto_remove, 2986 2985 .driver = { 2987 2986 .name = "artpec6-crypto", 2988 2987 .of_match_table = artpec6_crypto_of_match,