Commit 4f7f841f authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Herbert Xu

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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 5c5d9715
...@@ -1801,7 +1801,7 @@ static int safexcel_probe(struct platform_device *pdev) ...@@ -1801,7 +1801,7 @@ static int safexcel_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int safexcel_remove(struct platform_device *pdev) static void safexcel_remove(struct platform_device *pdev)
{ {
struct safexcel_crypto_priv *priv = platform_get_drvdata(pdev); struct safexcel_crypto_priv *priv = platform_get_drvdata(pdev);
int i; int i;
...@@ -1816,8 +1816,6 @@ static int safexcel_remove(struct platform_device *pdev) ...@@ -1816,8 +1816,6 @@ static int safexcel_remove(struct platform_device *pdev)
irq_set_affinity_hint(priv->ring[i].irq, NULL); irq_set_affinity_hint(priv->ring[i].irq, NULL);
destroy_workqueue(priv->ring[i].workqueue); destroy_workqueue(priv->ring[i].workqueue);
} }
return 0;
} }
static const struct safexcel_priv_data eip97ies_mrvl_data = { static const struct safexcel_priv_data eip97ies_mrvl_data = {
...@@ -1874,7 +1872,7 @@ MODULE_DEVICE_TABLE(of, safexcel_of_match_table); ...@@ -1874,7 +1872,7 @@ MODULE_DEVICE_TABLE(of, safexcel_of_match_table);
static struct platform_driver crypto_safexcel = { static struct platform_driver crypto_safexcel = {
.probe = safexcel_probe, .probe = safexcel_probe,
.remove = safexcel_remove, .remove_new = safexcel_remove,
.driver = { .driver = {
.name = "crypto-safexcel", .name = "crypto-safexcel",
.of_match_table = safexcel_of_match_table, .of_match_table = safexcel_of_match_table,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment