linux/drivers/crypto/stm32
Uwe Kleine-König afa39e6e2b crypto: stm32/crc32 - 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 (mostly) ignored
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.

The driver adapted here suffered from this wrong assumption and had an
error paths resulting in resource leaks.

If pm_runtime_get() fails, the other resources held by the device must
still be freed. Only clk_disable() should be skipped as the
pm_runtime_get() failed to call clk_enable().

After this change the remove function returns zero unconditionally and
can trivially be converted to the prototype required for .remove_new().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2023-10-27 18:04:27 +08:00
..
Kconfig crypto: stm32 - add new algorithms support 2023-07-22 13:59:38 +12:00
Makefile Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-07-08 20:57:08 -07:00
stm32-crc32.c crypto: stm32/crc32 - Convert to platform remove callback returning void 2023-10-27 18:04:27 +08:00
stm32-cryp.c crypto: drivers - Explicitly include correct DT includes 2023-08-23 11:04:23 +08:00
stm32-hash.c crypto: drivers - Explicitly include correct DT includes 2023-08-23 11:04:23 +08:00