[PATCH 075/113] ASoC: codecs: ac97: use snd_pcm_is_playback/capture()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We can use snd_pcm_is_playback/capture(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
 sound/soc/codecs/ac97.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index 0e013edfe63d7..aceeeae518d29 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -35,7 +35,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream,
 	struct snd_soc_component *component = dai->component;
 	struct snd_ac97 *ac97 = snd_soc_component_get_drvdata(component);
 
-	int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
+	int reg = snd_pcm_is_playback(substream) ?
 		  AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE;
 	return snd_ac97_set_rate(ac97, reg, substream->runtime->rate);
 }
-- 
2.43.0





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux