summaryrefslogtreecommitdiff
path: root/drivers/spi/spi-sh-hspi.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-10-20 10:56:00 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2023-10-27 13:04:27 +0300
commitafa39e6e2b8569ec280fd3e91d519537ef747d9a (patch)
treea23d67cf7c52e32e25ea94dcfbb832797f4a88fd /drivers/spi/spi-sh-hspi.c
parenta48c68aa298ccee2512c8bd2081350d465e95bc3 (diff)
downloadlinux-afa39e6e2b8569ec280fd3e91d519537ef747d9a.tar.xz
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>
Diffstat (limited to 'drivers/spi/spi-sh-hspi.c')
0 files changed, 0 insertions, 0 deletions