aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorOvidiu Panait <ovidiu.panait.oss@gmail.com>2025-04-25 15:45:17 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2025-04-28 19:45:26 +0800
commitb9580cf5f9ace0d64903164f553cbef674cefb46 (patch)
tree440129a27e8fbcc07f5396d62628114cf532b59e /drivers/crypto
parentcrypto: sun8i-ce-cipher - use IS_ENABLED() checks for debugfs stats (diff)
downloadlinux-rng-b9580cf5f9ace0d64903164f553cbef674cefb46.tar.xz
linux-rng-b9580cf5f9ace0d64903164f553cbef674cefb46.zip
crypto: sun8i-ce-cipher - use pm_runtime_resume_and_get()
Replace pm_runtime_get_sync() usage with pm_runtime_resume_and_get() to simplify error handling. This is recommended in the documentation of pm_runtime_get_sync(): /** * pm_runtime_get_sync - Bump up usage counter of a device and resume it. ... * Consider using pm_runtime_resume_and_get() instead of it, especially * if its return value is checked by the caller, as this is likely to result * in cleaner code. ... */ Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Tested-by: Corentin LABBE <clabbe.montjoie@gmail.com> Acked-by: Corentin LABBE <clabbe.montjoie@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
index 91bc3c2c488f..f9cf00d690e2 100644
--- a/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
+++ b/drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
@@ -455,13 +455,12 @@ int sun8i_ce_cipher_init(struct crypto_tfm *tfm)
crypto_skcipher_driver_name(op->fallback_tfm),
CRYPTO_MAX_ALG_NAME);
- err = pm_runtime_get_sync(op->ce->dev);
+ err = pm_runtime_resume_and_get(op->ce->dev);
if (err < 0)
goto error_pm;
return 0;
error_pm:
- pm_runtime_put_noidle(op->ce->dev);
crypto_free_skcipher(op->fallback_tfm);
return err;
}