Skip to content

Commit d152088

Browse files
Oleksandr Suvorovbroonie
authored andcommitted
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: 812ad46 ("ASoC: fsl_sai: Add support for runtime pm") Signed-off-by: Oleksandr Suvorov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 13426fe commit d152088

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

sound/soc/fsl/fsl_sai.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,12 +1020,24 @@ static int fsl_sai_probe(struct platform_device *pdev)
10201020
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component,
10211021
&fsl_sai_dai, 1);
10221022
if (ret)
1023-
return ret;
1023+
goto err_pm_disable;
10241024

1025-
if (sai->soc_data->use_imx_pcm)
1026-
return imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE);
1027-
else
1028-
return devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
1025+
if (sai->soc_data->use_imx_pcm) {
1026+
ret = imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE);
1027+
if (ret)
1028+
goto err_pm_disable;
1029+
} else {
1030+
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
1031+
if (ret)
1032+
goto err_pm_disable;
1033+
}
1034+
1035+
return ret;
1036+
1037+
err_pm_disable:
1038+
pm_runtime_disable(&pdev->dev);
1039+
1040+
return ret;
10291041
}
10301042

10311043
static int fsl_sai_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)