crypto: omap-sham - Use pm_runtime_resume_and_get() in omap_sham_probe()
PATCH 1/1 crypto: omap-sham - Use pm_runtime_resume_and_get() in omap_sham_probe()
omap_sham_probe() calls pm_runtime_get_sync() and calls pm_runtime_put_sync() latter to put usage_counter. However, pm_runtime_get_sync() will increment usage_counter even it failed. Fix it by replacing it with pm_runtime_resume_and_get() to keep usage counter balanced.
--- drivers/crypto/omap-sham.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/omap-sham.c +1 -1
@@ -2114,7 +2114,7 @@ static int omap_sham_probe(struct platform_device *pdev)pm_runtime_enable (dev); - err =pm_runtime_get_sync (dev); + err =pm_runtime_resume_and_get (dev);if (err <0 ) {dev_err (dev,"failed to get sync: %d\n" , err); goto err_pm;
Signature · 1 line
2.17.1
Quoted 17 lines · Shang XiaoJing
omap_sham_probe()callspm_runtime_get_sync()and callspm_runtime_put_sync()latter to putusage_counter. However,pm_runtime_get_sync()will incrementusage_countereven it failed. Fix it by replacing it withpm_runtime_resume_and_get()to keep usage counter balanced.Fixes b359f034c8bf ("crypto: omap-sham - Convert to use pm_runtime API")Signed-off-by Shang XiaoJing <[email protected]>--- drivers/crypto/omap-sham.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/crypto/omap-sham.c +0
-0
drivers/crypto/omap-sham.c static int omap_sham_probe(struct platform_device *pdev) · line 2120
Quoted 8 lines
drivers/crypto/omap-sham.c +1
-1@@ -2114,7 +2114,7 @@ static int omap_sham_probe(struct platform_device *pdev)pm_runtime_enable (dev); - err =pm_runtime_get_sync (dev); + err =pm_runtime_resume_and_get (dev);if (err <0 ) {dev_err (dev,"failed to get sync: %d\n" , err); goto err_pm;
I do not have the hardware to test this anymore but to the best of my knowledge, this is a good change. Thanks Shang.
Herbert Xu
maintainerQuoted 11 lines · Shang XiaoJing
omap_sham_probe()callspm_runtime_get_sync()and callspm_runtime_put_sync()latter to putusage_counter. However,pm_runtime_get_sync()will incrementusage_countereven it failed. Fix it by replacing it withpm_runtime_resume_and_get()to keep usage counter balanced.Fixes b359f034c8bf ("crypto: omap-sham - Convert to use pm_runtime API")Signed-off-by Shang XiaoJing <[email protected]>--- drivers/crypto/omap-sham.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt