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

crypto: inside-secure/safexcel - 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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Uwe Kleine-König and committed by
Herbert Xu
4f7f841f 5c5d9715

+2 -4
+2 -4
drivers/crypto/inside-secure/safexcel.c
··· 1801 1801 return ret; 1802 1802 } 1803 1803 1804 - static int safexcel_remove(struct platform_device *pdev) 1804 + static void safexcel_remove(struct platform_device *pdev) 1805 1805 { 1806 1806 struct safexcel_crypto_priv *priv = platform_get_drvdata(pdev); 1807 1807 int i; ··· 1816 1816 irq_set_affinity_hint(priv->ring[i].irq, NULL); 1817 1817 destroy_workqueue(priv->ring[i].workqueue); 1818 1818 } 1819 - 1820 - return 0; 1821 1819 } 1822 1820 1823 1821 static const struct safexcel_priv_data eip97ies_mrvl_data = { ··· 1872 1874 1873 1875 static struct platform_driver crypto_safexcel = { 1874 1876 .probe = safexcel_probe, 1875 - .remove = safexcel_remove, 1877 + .remove_new = safexcel_remove, 1876 1878 .driver = { 1877 1879 .name = "crypto-safexcel", 1878 1880 .of_match_table = safexcel_of_match_table,