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

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Ovidiu Panait and committed by
Herbert Xu
b9580cf5 031bc3e8

+1 -2
+1 -2
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-cipher.c
··· 455 455 crypto_skcipher_driver_name(op->fallback_tfm), 456 456 CRYPTO_MAX_ALG_NAME); 457 457 458 - err = pm_runtime_get_sync(op->ce->dev); 458 + err = pm_runtime_resume_and_get(op->ce->dev); 459 459 if (err < 0) 460 460 goto error_pm; 461 461 462 462 return 0; 463 463 error_pm: 464 - pm_runtime_put_noidle(op->ce->dev); 465 464 crypto_free_skcipher(op->fallback_tfm); 466 465 return err; 467 466 }