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

crypto: ccp/sp - 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>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Uwe Kleine-König and committed by
Herbert Xu
11575ef9 304a2efe

+2 -4
+2 -4
drivers/crypto/ccp/sp-platform.c
··· 180 180 return ret; 181 181 } 182 182 183 - static int sp_platform_remove(struct platform_device *pdev) 183 + static void sp_platform_remove(struct platform_device *pdev) 184 184 { 185 185 struct device *dev = &pdev->dev; 186 186 struct sp_device *sp = dev_get_drvdata(dev); ··· 188 188 sp_destroy(sp); 189 189 190 190 dev_notice(dev, "disabled\n"); 191 - 192 - return 0; 193 191 } 194 192 195 193 #ifdef CONFIG_PM ··· 220 222 #endif 221 223 }, 222 224 .probe = sp_platform_probe, 223 - .remove = sp_platform_remove, 225 + .remove_new = sp_platform_remove, 224 226 #ifdef CONFIG_PM 225 227 .suspend = sp_platform_suspend, 226 228 .resume = sp_platform_resume,