summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorŁukasz Stelmach <l.stelmach@samsung.com>2021-05-05 20:29:14 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 16:53:11 +0200
commitf4c8a00d61fef36f598857d6db40b3855161a41e (patch)
tree3c0477aaf266170ab344cef832577c68511b2363 /drivers/char
parent022cf057e4432f8f32717ae1edfcc37e8c1a915e (diff)
downloadlinux-f4c8a00d61fef36f598857d6db40b3855161a41e.tar.gz
linux-f4c8a00d61fef36f598857d6db40b3855161a41e.tar.bz2
linux-f4c8a00d61fef36f598857d6db40b3855161a41e.zip
hwrng: exynos - Fix runtime PM imbalance on error
[ Upstream commit 0cdbabf8bb7a6147f5adf37dbc251e92a1bbc2c7 ] pm_runtime_resume_and_get() wraps around pm_runtime_get_sync() and decrements the runtime PM usage counter in case the latter function fails and keeps the counter balanced. Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/hw_random/exynos-trng.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/hw_random/exynos-trng.c b/drivers/char/hw_random/exynos-trng.c
index b4b52ab23b6b..b4e931dbff66 100644
--- a/drivers/char/hw_random/exynos-trng.c
+++ b/drivers/char/hw_random/exynos-trng.c
@@ -134,7 +134,7 @@ static int exynos_trng_probe(struct platform_device *pdev)
return PTR_ERR(trng->mem);
pm_runtime_enable(&pdev->dev);
- ret = pm_runtime_get_sync(&pdev->dev);
+ ret = pm_runtime_resume_and_get(&pdev->dev);
if (ret < 0) {
dev_err(&pdev->dev, "Could not get runtime PM.\n");
goto err_pm_get;
@@ -167,7 +167,7 @@ err_register:
clk_disable_unprepare(trng->clk);
err_clock:
- pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_put_noidle(&pdev->dev);
err_pm_get:
pm_runtime_disable(&pdev->dev);