]> Git Repo - linux.git/commitdiff
ASoC: img-i2s-out: Fix runtime PM imbalance on error
authorDinghao Liu <[email protected]>
Fri, 29 May 2020 01:22:28 +0000 (09:22 +0800)
committerMark Brown <[email protected]>
Fri, 29 May 2020 12:30:04 +0000 (13:30 +0100)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
sound/soc/img/img-i2s-out.c

index db052ec17d5d8ca26912b081bdb5ecc18641f797..b56a18e7f3ac7c20ae4802c7d157bc3d3bb39da9 100644 (file)
@@ -347,8 +347,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);
 
@@ -488,8 +490,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);
This page took 0.053024 seconds and 4 git commands to generate.