[PATCH 011/113] ALSA: arm: 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/arm/aaci.c        | 4 ++--
 sound/arm/pxa2xx-ac97.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index c3340b8ff3daf..5542c18cf2191 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -403,7 +403,7 @@ static int aaci_pcm_open(struct snd_pcm_substream *substream)
 	struct aaci_runtime *aacirun;
 	int ret = 0;
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(substream)) {
 		aacirun = &aaci->playback;
 	} else {
 		aacirun = &aaci->capture;
@@ -415,7 +415,7 @@ static int aaci_pcm_open(struct snd_pcm_substream *substream)
 	runtime->hw.rates = aacirun->pcm->rates;
 	snd_pcm_limit_hw_rates(runtime);
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(substream)) {
 		runtime->hw.channels_max = 6;
 
 		/* Add rule describing channel dependency. */
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index 4c367e73b2c9b..bce0c7ca4b707 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -71,7 +71,7 @@ static int pxa2xx_ac97_pcm_open(struct snd_pcm_substream *substream)
 	runtime->hw.channels_min = 2;
 	runtime->hw.channels_max = 2;
 
-	i = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ?
+	i = (snd_pcm_is_playback(substream)) ?
 		AC97_RATES_FRONT_DAC : AC97_RATES_ADC;
 	runtime->hw.rates = pxa2xx_ac97_ac97->rates[i];
 	snd_pcm_limit_hw_rates(runtime);
@@ -100,7 +100,7 @@ static int pxa2xx_ac97_pcm_close(struct snd_pcm_substream *substream)
 static int pxa2xx_ac97_pcm_prepare(struct snd_pcm_substream *substream)
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
-	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;
 	int ret;
 
-- 
2.43.0




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux