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

crypto: ccree/cc - 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
e7edfb41 11575ef9

+2 -4
+2 -4
drivers/crypto/ccree/cc_driver.c
··· 623 623 return 0; 624 624 } 625 625 626 - static int ccree_remove(struct platform_device *plat_dev) 626 + static void ccree_remove(struct platform_device *plat_dev) 627 627 { 628 628 struct device *dev = &plat_dev->dev; 629 629 ··· 632 632 cleanup_cc_resources(plat_dev); 633 633 634 634 dev_info(dev, "ARM ccree device terminated\n"); 635 - 636 - return 0; 637 635 } 638 636 639 637 static struct platform_driver ccree_driver = { ··· 643 645 #endif 644 646 }, 645 647 .probe = ccree_probe, 646 - .remove = ccree_remove, 648 + .remove_new = ccree_remove, 647 649 }; 648 650 649 651 static int __init ccree_init(void)