]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: stm: use snd_pcm_direction_name()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 30 Jul 2024 02:05:39 +0000 (02:05 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 1 Aug 2024 13:54:48 +0000 (14:54 +0100)
We already have snd_pcm_direction_name(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87o76fk51p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/stm/stm32_i2s.c

index 46098e11114228e40d2c261257751363d8feed7f..a96aa308681a20214783272000417e3b8ebdabef 100644 (file)
@@ -823,7 +823,7 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
                /* Enable i2s */
                dev_dbg(cpu_dai->dev, "start I2S %s\n",
-                       playback_flg ? "playback" : "capture");
+                       snd_pcm_direction_name(substream->stream));
 
                cfg1_mask = I2S_CFG1_RXDMAEN | I2S_CFG1_TXDMAEN;
                regmap_update_bits(i2s->regmap, STM32_I2S_CFG1_REG,
@@ -869,7 +869,7 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
        case SNDRV_PCM_TRIGGER_SUSPEND:
        case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
                dev_dbg(cpu_dai->dev, "stop I2S %s\n",
-                       playback_flg ? "playback" : "capture");
+                       snd_pcm_direction_name(substream->stream));
 
                if (playback_flg)
                        regmap_update_bits(i2s->regmap, STM32_I2S_IER_REG,