mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
ASoC: img-i2s-out: Fix runtime PM imbalance on error
[ Upstream commit 65bd91dd69
]
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Link: https://lore.kernel.org/r/20200529012230.5863-1-dinghao.liu@zju.edu.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a63689c06a
commit
fce356afe0
@ -350,8 +350,10 @@ static int img_i2s_out_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
|
||||
chan_control_mask = IMG_I2S_OUT_CHAN_CTL_CLKT_MASK;
|
||||
|
||||
ret = pm_runtime_get_sync(i2s->dev);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
pm_runtime_put_noidle(i2s->dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
img_i2s_out_disable(i2s);
|
||||
|
||||
@ -491,8 +493,10 @@ static int img_i2s_out_probe(struct platform_device *pdev)
|
||||
goto err_pm_disable;
|
||||
}
|
||||
ret = pm_runtime_get_sync(&pdev->dev);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
goto err_suspend;
|
||||
}
|
||||
|
||||
reg = IMG_I2S_OUT_CTL_FRM_SIZE_MASK;
|
||||
img_i2s_out_writel(i2s, reg, IMG_I2S_OUT_CTL);
|
||||
|
Loading…
Reference in New Issue
Block a user