diff mbox series

[112/113] ASoC: hisilicon: use snd_pcm_is_playback/capture()

Message ID 87mslrvlw1.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show
Series ALSA: add snd_pcm_is_playback/capture() macro | expand

Commit Message

Kuninori Morimoto Aug. 5, 2024, 12:44 a.m. UTC
We can use snd_pcm_is_playback/capture(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/hisilicon/hi6210-i2s.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/hisilicon/hi6210-i2s.c b/sound/soc/hisilicon/hi6210-i2s.c
index 250ae3781d140..37ffec8ff721f 100644
--- a/sound/soc/hisilicon/hi6210-i2s.c
+++ b/sound/soc/hisilicon/hi6210-i2s.c
@@ -421,7 +421,7 @@  static int hi6210_i2s_hw_params(struct snd_pcm_substream *substream,
 
 	dma_data->maxburst = 2;
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		dma_data->addr = i2s->base_phys + HII2S_ST_DL_CHANNEL;
 	else
 		dma_data->addr = i2s->base_phys + HII2S_STEREO_UPLINK_CHANNEL;
@@ -478,14 +478,14 @@  static int hi6210_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
-		if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+		if (snd_pcm_is_capture(substream))
 			hi6210_i2s_rxctrl(cpu_dai, 1);
 		else
 			hi6210_i2s_txctrl(cpu_dai, 1);
 		break;
 	case SNDRV_PCM_TRIGGER_STOP:
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
-		if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+		if (snd_pcm_is_capture(substream))
 			hi6210_i2s_rxctrl(cpu_dai, 0);
 		else
 			hi6210_i2s_txctrl(cpu_dai, 0);