diff mbox series

[011/113] ALSA: arm: use snd_pcm_is_playback/capture()

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

Commit Message

Kuninori Morimoto Aug. 5, 2024, 12:35 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/arm/aaci.c        | 4 ++--
 sound/arm/pxa2xx-ac97.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

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;