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

crypto: omap-des - 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
edfb5a04 e0dffa0e

+2 -4
+2 -4
drivers/crypto/omap-des.c
··· 1072 1072 return err; 1073 1073 } 1074 1074 1075 - static int omap_des_remove(struct platform_device *pdev) 1075 + static void omap_des_remove(struct platform_device *pdev) 1076 1076 { 1077 1077 struct omap_des_dev *dd = platform_get_drvdata(pdev); 1078 1078 int i, j; ··· 1089 1089 tasklet_kill(&dd->done_task); 1090 1090 omap_des_dma_cleanup(dd); 1091 1091 pm_runtime_disable(dd->dev); 1092 - 1093 - return 0; 1094 1092 } 1095 1093 1096 1094 #ifdef CONFIG_PM_SLEEP ··· 1115 1117 1116 1118 static struct platform_driver omap_des_driver = { 1117 1119 .probe = omap_des_probe, 1118 - .remove = omap_des_remove, 1120 + .remove_new = omap_des_remove, 1119 1121 .driver = { 1120 1122 .name = "omap-des", 1121 1123 .pm = &omap_des_pm_ops,