[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200417142122.10212-1-olivier.moysan@st.com>
Date: Fri, 17 Apr 2020 16:21:22 +0200
From: Olivier Moysan <olivier.moysan@...com>
To: <lgirdwood@...il.com>, <broonie@...nel.org>, <perex@...ex.cz>,
<tiwai@...e.com>, <alexandre.torgue@...com>,
<olivier.moysan@...com>
CC: <alsa-devel@...a-project.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] ASoC: stm32: sai: fix sai probe
pcm config must be set before snd_dmaengine_pcm_register() call.
Fixes: 0d6defc7e0e4 ("ASoC: stm32: sai: manage rebind issue")
Signed-off-by: Olivier Moysan <olivier.moysan@...com>
---
sound/soc/stm/stm32_sai_sub.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index 34a7c3d6fb91..41f01c3e639e 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -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)
--
2.17.1
Powered by blists - more mailing lists