From: phucduc.bui@gmail.com
To: Mark Brown <broonie@kernel.org>,
Olivier Moysan <olivier.moysan@foss.st.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 3/3] ASoC: stm32: spdifrx: Enable clock before setting substream
Date: Fri, 27 Nov 2026 16:23:45 +0700 [thread overview]
Message-ID: <20261127092345.12383-4-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20261127092345.12383-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Enable the clock before assigning the substream to avoid leaving
a stale substream pointer if clock enabling fails.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/stm/stm32_spdifrx.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c
index ba6c715750aa..1d62a6fdc472 100644
--- a/sound/soc/stm/stm32_spdifrx.c
+++ b/sound/soc/stm/stm32_spdifrx.c
@@ -753,14 +753,16 @@ static int stm32_spdifrx_startup(struct snd_pcm_substream *substream,
struct stm32_spdifrx_data *spdifrx = snd_soc_dai_get_drvdata(cpu_dai);
int ret;
+ ret = clk_prepare_enable(spdifrx->kclk);
+ if (ret) {
+ dev_err(&spdifrx->pdev->dev, "Enable kclk failed: %d\n", ret);
+ return ret;
+ }
+
scoped_guard(spinlock_irqsave, &spdifrx->irq_lock)
spdifrx->substream = substream;
- ret = clk_prepare_enable(spdifrx->kclk);
- if (ret)
- dev_err(&spdifrx->pdev->dev, "Enable kclk failed: %d\n", ret);
-
- return ret;
+ return 0;
}
static int stm32_spdifrx_hw_params(struct snd_pcm_substream *substream,
--
2.43.0
next prev parent reply other threads:[~2026-11-27 9:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 9:23 [PATCH 0/3] ASoC: stm32: spdifrx: Fix resource handling and startup phucduc.bui
2026-11-27 9:23 ` [PATCH 1/3] ASoC: stm32: spdifrx: Use devm helpers and drop remove callback phucduc.bui
2026-11-27 9:23 ` [PATCH 2/3] ASoC: stm32: spdifrx: Fix refcount on sync failure phucduc.bui
2026-11-27 9:34 ` sashiko-bot
2026-11-27 9:41 ` Bui Duc Phuc
2026-11-27 9:23 ` phucduc.bui [this message]
2026-11-27 9:28 ` [PATCH 3/3] ASoC: stm32: spdifrx: Enable clock before setting substream sashiko-bot
2026-11-27 9:41 ` Bui Duc Phuc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261127092345.12383-4-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=arnaud.pouliquen@foss.st.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=olivier.moysan@foss.st.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox