diff mbox series

ASoC: soc-pcm: reuse dpcm_state_string()

Message ID 87y0xi52vx.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Commit 7a2ff0510c51462c0a979f5006d375a2b23d46e9
Headers show
Series ASoC: soc-pcm: reuse dpcm_state_string() | expand

Commit Message

Kuninori Morimoto March 6, 2025, 2:06 a.m. UTC
We already have dpcm_state_string(). Let's reuse it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-pcm.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Mark Brown March 6, 2025, 6:58 p.m. UTC | #1
On Thu, 06 Mar 2025 02:06:27 +0000, Kuninori Morimoto wrote:
> We already have dpcm_state_string(). Let's reuse it.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: soc-pcm: reuse dpcm_state_string()
      commit: 7a2ff0510c51462c0a979f5006d375a2b23d46e9

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 73b05b8f5a07..88c948911aa3 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -144,7 +144,6 @@  static inline const char *soc_codec_dai_name(struct snd_soc_pcm_runtime *rtd)
 	return (rtd)->dai_link->num_codecs == 1 ? snd_soc_rtd_to_codec(rtd, 0)->name : "multicodec";
 }
 
-#ifdef CONFIG_DEBUG_FS
 static const char *dpcm_state_string(enum snd_soc_dpcm_state state)
 {
 	switch (state) {
@@ -173,6 +172,7 @@  static const char *dpcm_state_string(enum snd_soc_dpcm_state state)
 	return "unknown";
 }
 
+#ifdef CONFIG_DEBUG_FS
 static ssize_t dpcm_show_state(struct snd_soc_pcm_runtime *fe,
 			       int stream, char *buf, size_t size)
 {
@@ -1636,9 +1636,9 @@  void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream,
 			continue;
 
 		if (be->dpcm[stream].users == 0) {
-			dev_err(be->dev, "ASoC: no users %s at close - state %d\n",
+			dev_err(be->dev, "ASoC: no users %s at close - state %s\n",
 				snd_pcm_direction_name(stream),
-				be->dpcm[stream].state);
+				dpcm_state_string(be->dpcm[stream].state));
 			continue;
 		}
 
@@ -1687,9 +1687,9 @@  int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
 
 		/* first time the dpcm is open ? */
 		if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) {
-			dev_err(be->dev, "ASoC: too many users %s at open %d\n",
+			dev_err(be->dev, "ASoC: too many users %s at open %s\n",
 				snd_pcm_direction_name(stream),
-				be->dpcm[stream].state);
+				dpcm_state_string(be->dpcm[stream].state));
 			continue;
 		}
 
@@ -1708,9 +1708,9 @@  int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream)
 		if (err < 0) {
 			be->dpcm[stream].users--;
 			if (be->dpcm[stream].users < 0)
-				dev_err(be->dev, "ASoC: no users %s at unwind %d\n",
+				dev_err(be->dev, "ASoC: no users %s at unwind %s\n",
 					snd_pcm_direction_name(stream),
-					be->dpcm[stream].state);
+					dpcm_state_string(be->dpcm[stream].state));
 
 			be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE;
 			goto unwind;
@@ -2572,8 +2572,8 @@  static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream)
 	/* Only start the BE if the FE is ready */
 	if (fe->dpcm[stream].state == SND_SOC_DPCM_STATE_HW_FREE ||
 		fe->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE) {
-		dev_err(fe->dev, "ASoC: FE %s is not ready %d\n",
-			fe->dai_link->name, fe->dpcm[stream].state);
+		dev_err(fe->dev, "ASoC: FE %s is not ready %s\n",
+			fe->dai_link->name, dpcm_state_string(fe->dpcm[stream].state));
 		ret = -EINVAL;
 		goto disconnect;
 	}