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

crypto: intel/keembay-ocs-hcu - 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
b28e9179 b6b73a24

+2 -4
+2 -4
drivers/crypto/intel/keembay/keembay-ocs-hcu-core.c
··· 1151 1151 {} 1152 1152 }; 1153 1153 1154 - static int kmb_ocs_hcu_remove(struct platform_device *pdev) 1154 + static void kmb_ocs_hcu_remove(struct platform_device *pdev) 1155 1155 { 1156 1156 struct ocs_hcu_dev *hcu_dev = platform_get_drvdata(pdev); 1157 1157 ··· 1162 1162 spin_lock_bh(&ocs_hcu.lock); 1163 1163 list_del(&hcu_dev->list); 1164 1164 spin_unlock_bh(&ocs_hcu.lock); 1165 - 1166 - return 0; 1167 1165 } 1168 1166 1169 1167 static int kmb_ocs_hcu_probe(struct platform_device *pdev) ··· 1242 1244 /* The OCS driver is a platform device. */ 1243 1245 static struct platform_driver kmb_ocs_hcu_driver = { 1244 1246 .probe = kmb_ocs_hcu_probe, 1245 - .remove = kmb_ocs_hcu_remove, 1247 + .remove_new = kmb_ocs_hcu_remove, 1246 1248 .driver = { 1247 1249 .name = DRV_NAME, 1248 1250 .of_match_table = kmb_ocs_hcu_of_match,