diff mbox series

[015/112] ALSA: pci: ac97: use snd_pcm_is_playback/capture()

Message ID 87msm7ft23.wl-kuninori.morimoto.gx@renesas.com
State Superseded
Headers show
Series [001/112] ALSA: add snd_pcm_is_playback/capture() macro | expand

Commit Message

Kuninori Morimoto July 24, 2024, 2 a.m. UTC
We can use snd_pcm_is_playback/capture(). Let's use it.

Because it is using bit-field, can't use snd_pcm_is_playback(),
uses snd_pcm_direction_is_playback() directly.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/pci/ac97/ac97_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c
index 5fee8e89790fb..2d8276d2d32f4 100644
--- a/sound/pci/ac97/ac97_pcm.c
+++ b/sound/pci/ac97/ac97_pcm.c
@@ -150,7 +150,7 @@  static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx,
 		return 0xff;
 	if (pcm->spdif)
 		return AC97_SPDIF; /* pseudo register */
-	if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_direction_is_playback(pcm->stream))
 		return rate_reg_tables[dbl][pcm->r[dbl].rate_table[cidx]][slot - 3];
 	else
 		return rate_cregs[slot - 3];
@@ -512,7 +512,7 @@  int snd_ac97_pcm_assign(struct snd_ac97_bus *bus,
 			rpcm->rates &= rates;
 		}
 		/* for double rate, we check the first codec only */
-		if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+		if (snd_pcm_direction_is_playback(pcm->stream) &&
 		    bus->codec[0] && (bus->codec[0]->flags & AC97_DOUBLE_RATE) &&
 		    rate_table[pcm->stream][0] == 0) {
 			tmp = (1<<AC97_SLOT_PCM_LEFT) | (1<<AC97_SLOT_PCM_RIGHT) |