diff mbox series

[103/113] ASoC: codecs: tlv320aic23: use snd_pcm_is_playback/capture()

Message ID 87zfprvlx2.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/tlv320aic23.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
index c47aa4d4162dd..06dab9d9b7576 100644
--- a/sound/soc/codecs/tlv320aic23.c
+++ b/sound/soc/codecs/tlv320aic23.c
@@ -342,7 +342,7 @@  static int tlv320aic23_hw_params(struct snd_pcm_substream *substream,
 	u32 sample_rate_dac = aic23->requested_dac;
 	u32 sample_rate = params_rate(params);
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(substream)) {
 		aic23->requested_dac = sample_rate_dac = sample_rate;
 		if (!sample_rate_adc)
 			sample_rate_adc = sample_rate;
@@ -398,7 +398,7 @@  static void tlv320aic23_shutdown(struct snd_pcm_substream *substream,
 		udelay(50);
 		snd_soc_component_write(component, TLV320AIC23_ACTIVE, 0x0);
 	}
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		aic23->requested_dac = 0;
 	else
 		aic23->requested_adc = 0;