summaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2021-12-17 10:22:31 +0100
committerMark Brown <broonie@kernel.org>2021-12-17 16:21:17 +0000
commitf04b4fb47d83b110a5b007fb2eddea862cfeb151 (patch)
tree2af42e8925db7296288235e7a30788af6599f24c /sound/soc/sh
parent4941cd7cc845ae0a5317b1462e1b11bab4c023c0 (diff)
downloadlinux-stable-f04b4fb47d83b110a5b007fb2eddea862cfeb151.tar.gz
linux-stable-f04b4fb47d83b110a5b007fb2eddea862cfeb151.tar.bz2
linux-stable-f04b4fb47d83b110a5b007fb2eddea862cfeb151.zip
ASoC: sh: rz-ssi: Check return value of pm_runtime_resume_and_get()
The return value of pm_runtime_resume_and_get() needs to be checked to avoid a usage count imbalance in the error case. This fix is basically the same as 92c959bae2e5 ("reset: renesas: Fix Runtime PM usage"), and the last step before pm_runtime_resume_and_get() can be annotated as __must_check. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/9fed506d-b780-55cd-45a4-9bd2407c910f@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/rz-ssi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c
index fa0cc08f70ec..e8d98b362f9d 100644
--- a/sound/soc/sh/rz-ssi.c
+++ b/sound/soc/sh/rz-ssi.c
@@ -1020,7 +1020,12 @@ static int rz_ssi_probe(struct platform_device *pdev)
reset_control_deassert(ssi->rstc);
pm_runtime_enable(&pdev->dev);
- pm_runtime_resume_and_get(&pdev->dev);
+ ret = pm_runtime_resume_and_get(&pdev->dev);
+ if (ret < 0) {
+ pm_runtime_disable(ssi->dev);
+ reset_control_assert(ssi->rstc);
+ return dev_err_probe(ssi->dev, ret, "pm_runtime_resume_and_get failed\n");
+ }
spin_lock_init(&ssi->lock);
dev_set_drvdata(&pdev->dev, ssi);