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

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: 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
580399bb a63e2236

+2 -3
+2 -3
drivers/crypto/bcm/cipher.c
··· 4713 4713 return err; 4714 4714 } 4715 4715 4716 - static int bcm_spu_remove(struct platform_device *pdev) 4716 + static void bcm_spu_remove(struct platform_device *pdev) 4717 4717 { 4718 4718 int i; 4719 4719 struct device *dev = &pdev->dev; ··· 4751 4751 } 4752 4752 spu_free_debugfs(); 4753 4753 spu_mb_release(pdev); 4754 - return 0; 4755 4754 } 4756 4755 4757 4756 /* ===== Kernel Module API ===== */ ··· 4761 4762 .of_match_table = of_match_ptr(bcm_spu_dt_ids), 4762 4763 }, 4763 4764 .probe = bcm_spu_probe, 4764 - .remove = bcm_spu_remove, 4765 + .remove_new = bcm_spu_remove, 4765 4766 }; 4766 4767 module_platform_driver(bcm_spu_pdriver); 4767 4768