summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_spdif.c
diff options
context:
space:
mode:
authorOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-12-23 14:05:24 +0200
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2020-12-24 10:48:00 +0000
commit9165d659e4a66ce01b785d2f645c5b36efb364cc (patch)
treefd26aa89519227c5577ed8e0bef72339b82ed48b /sound/soc/fsl/fsl_spdif.c
parent82b6305ffb30ad2848a58bbea82225e809e73659 (diff)
sound: soc: fsl-spdif: Fix runtime PM imbalance on error
In case of any error occurs after enabling the PM runtime framework for the fsl-spdif-dai device, the next probing generates the warning: "fsl-spdif-dai 2004000.spdif: Unbalanced pm_runtime_enable!" Add the error handling path to keep the PM runtime usage counter balanced. Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Diffstat (limited to 'sound/soc/fsl/fsl_spdif.c')
-rw-r--r--sound/soc/fsl/fsl_spdif.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 93689892e97b..07f9ae81861c 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -1525,12 +1525,20 @@ static int fsl_spdif_probe(struct platform_device *pdev)
&spdif_priv->cpu_dai_drv, 1);
if (ret) {
dev_err(&pdev->dev, "failed to register DAI: %d\n", ret);
- return ret;
+ goto disable_pm_runtime;
}
ret = imx_pcm_dma_init(pdev, IMX_SPDIF_DMABUF_SIZE);
- if (ret && ret != -EPROBE_DEFER)
- dev_err(&pdev->dev, "imx_pcm_dma_init failed: %d\n", ret);
+ if (ret) {
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev, "imx_pcm_dma_init failed: %d\n", ret);
+ goto disable_pm_runtime;
+ }
+
+ return 0;
+
+disable_pm_runtime:
+ pm_runtime_disable(&pdev->dev);
return ret;
}