Commit e2bcb657 authored by Olivier Moysan's avatar Olivier Moysan Committed by Mark Brown

ASoC: stm32: sai: fix sai probe

pcm config must be set before snd_dmaengine_pcm_register() call.

Fixes: 0d6defc7 ("ASoC: stm32: sai: manage rebind issue")
Signed-off-by: default avatarOlivier Moysan <olivier.moysan@st.com>
Link: https://lore.kernel.org/r/20200417142122.10212-1-olivier.moysan@st.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 15a5760c
......@@ -1547,6 +1547,9 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
return ret;
}
if (STM_SAI_PROTOCOL_IS_SPDIF(sai))
conf = &stm32_sai_pcm_config_spdif;
ret = snd_dmaengine_pcm_register(&pdev->dev, conf, 0);
if (ret) {
if (ret != -EPROBE_DEFER)
......@@ -1556,15 +1559,10 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
ret = snd_soc_register_component(&pdev->dev, &stm32_component,
&sai->cpu_dai_drv, 1);
if (ret) {
if (ret)
snd_dmaengine_pcm_unregister(&pdev->dev);
return ret;
}
if (STM_SAI_PROTOCOL_IS_SPDIF(sai))
conf = &stm32_sai_pcm_config_spdif;
return 0;
return ret;
}
static int stm32_sai_sub_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