diff mbox series

[099/113] ASoC: codecs: tscs4xxx: use snd_pcm_is_playback/capture()

Message ID 875xsfx0hy.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:43 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/codecs/tscs42xx.c | 4 ++--
 sound/soc/codecs/tscs454.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/codecs/tscs42xx.c b/sound/soc/codecs/tscs42xx.c
index f8a3d1b40990c..dd87a37b97854 100644
--- a/sound/soc/codecs/tscs42xx.c
+++ b/sound/soc/codecs/tscs42xx.c
@@ -1178,12 +1178,12 @@  static int tscs42xx_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
 	int ret;
 
 	if (mute)
-		if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+		if (snd_pcm_is_playback(stream))
 			ret = dac_mute(component);
 		else
 			ret = adc_mute(component);
 	else
-		if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+		if (snd_pcm_is_playback(stream))
 			ret = dac_unmute(component);
 		else
 			ret = adc_unmute(component);
diff --git a/sound/soc/codecs/tscs454.c b/sound/soc/codecs/tscs454.c
index 850e5de9271ed..b8ee1281db489 100644
--- a/sound/soc/codecs/tscs454.c
+++ b/sound/soc/codecs/tscs454.c
@@ -3221,7 +3221,7 @@  static int tscs454_hw_params(struct snd_pcm_substream *substream,
 	}
 
 	set_aif_status_active(&tscs454->aifs_status, aif->id,
-			substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
+			      snd_pcm_is_playback(substream));
 
 	dev_dbg(component->dev, "Set aif %d active. Streams status is 0x%x\n",
 		aif->id, tscs454->aifs_status.streams);
@@ -3241,7 +3241,7 @@  static int tscs454_hw_free(struct snd_pcm_substream *substream,
 	struct aif *aif = &tscs454->aifs[dai->id];
 
 	return aif_free(component, aif,
-			substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
+			snd_pcm_is_playback(substream));
 }
 
 static int tscs454_prepare(struct snd_pcm_substream *substream,