Skip to content

Commit

Permalink
ASoC: sh: rz-ssi: Check return value of pm_runtime_resume_and_get()
Browse files Browse the repository at this point in the history
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 92c959b ("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>
  • Loading branch information
Heiner Kallweit authored and Mark Brown committed Dec 17, 2021
1 parent 4941cd7 commit f04b4fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sound/soc/sh/rz-ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f04b4fb

Please sign in to comment.