Commit d1520889 authored by Oleksandr Suvorov's avatar Oleksandr Suvorov Committed by Mark Brown

ASoC: fsl_sai: Fix exiting path on probing failure

If the imx-sdma driver is built as a module, the fsl-sai device doesn't
disable on probing failure, which causes the warning in the next probing:

==================================================================
fsl-sai 308a0000.sai: Unbalanced pm_runtime_enable!
fsl-sai 308a0000.sai: Unbalanced pm_runtime_enable!
fsl-sai 308a0000.sai: Unbalanced pm_runtime_enable!
fsl-sai 308a0000.sai: Unbalanced pm_runtime_enable!
fsl-sai 308a0000.sai: Unbalanced pm_runtime_enable!
fsl-sai 308a0000.sai: Unbalanced pm_runtime_enable!
==================================================================

Disabling the device properly fixes the issue.

Fixes: 812ad463 ("ASoC: fsl_sai: Add support for runtime pm")
Signed-off-by: default avatarOleksandr Suvorov <oleksandr.suvorov@toradex.com>
Link: https://lore.kernel.org/r/20200205160436.3813642-1-oleksandr.suvorov@toradex.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 13426fea
...@@ -1020,12 +1020,24 @@ static int fsl_sai_probe(struct platform_device *pdev) ...@@ -1020,12 +1020,24 @@ static int fsl_sai_probe(struct platform_device *pdev)
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component, ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component,
&fsl_sai_dai, 1); &fsl_sai_dai, 1);
if (ret) if (ret)
return ret; goto err_pm_disable;
if (sai->soc_data->use_imx_pcm) if (sai->soc_data->use_imx_pcm) {
return imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE); ret = imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE);
else if (ret)
return devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0); goto err_pm_disable;
} else {
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
if (ret)
goto err_pm_disable;
}
return ret;
err_pm_disable:
pm_runtime_disable(&pdev->dev);
return ret;
} }
static int fsl_sai_remove(struct platform_device *pdev) static int fsl_sai_remove(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment