Commit 580399bb authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Herbert Xu

crypto: bcm/cipher - 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 a63e2236
...@@ -4713,7 +4713,7 @@ static int bcm_spu_probe(struct platform_device *pdev) ...@@ -4713,7 +4713,7 @@ static int bcm_spu_probe(struct platform_device *pdev)
return err; return err;
} }
static int bcm_spu_remove(struct platform_device *pdev) static void bcm_spu_remove(struct platform_device *pdev)
{ {
int i; int i;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
...@@ -4751,7 +4751,6 @@ static int bcm_spu_remove(struct platform_device *pdev) ...@@ -4751,7 +4751,6 @@ static int bcm_spu_remove(struct platform_device *pdev)
} }
spu_free_debugfs(); spu_free_debugfs();
spu_mb_release(pdev); spu_mb_release(pdev);
return 0;
} }
/* ===== Kernel Module API ===== */ /* ===== Kernel Module API ===== */
...@@ -4762,7 +4761,7 @@ static struct platform_driver bcm_spu_pdriver = { ...@@ -4762,7 +4761,7 @@ static struct platform_driver bcm_spu_pdriver = {
.of_match_table = of_match_ptr(bcm_spu_dt_ids), .of_match_table = of_match_ptr(bcm_spu_dt_ids),
}, },
.probe = bcm_spu_probe, .probe = bcm_spu_probe,
.remove = bcm_spu_remove, .remove_new = bcm_spu_remove,
}; };
module_platform_driver(bcm_spu_pdriver); module_platform_driver(bcm_spu_pdriver);
......
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