diff mbox series

[016/113] ALSA: pci: nm256: use snd_pcm_is_playback/capture()

Message ID 87h6bz24d4.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: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/pci/nm256/nm256.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 11ba7d4eac2a4..4ad3734796ed6 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -332,7 +332,7 @@  snd_nm256_load_one_coefficient(struct nm256 *chip, int stream, u32 port, int whi
 	snd_nm256_write_buffer(chip, coefficients + offset, coeff_buf, size);
 	snd_nm256_writel(chip, port, coeff_buf);
 	/* ???  Record seems to behave differently than playback.  */
-	if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(stream))
 		size--;
 	snd_nm256_writel(chip, port + 4, coeff_buf + size);
 }
@@ -341,11 +341,11 @@  static void
 snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number)
 {
 	/* The enable register for the specified engine.  */
-	u32 poffset = (stream == SNDRV_PCM_STREAM_CAPTURE ?
+	u32 poffset = (snd_pcm_is_capture(stream) ?
 		       NM_RECORD_ENABLE_REG : NM_PLAYBACK_ENABLE_REG);
 	u32 addr = NM_COEFF_START_OFFSET;
 
-	addr += (stream == SNDRV_PCM_STREAM_CAPTURE ?
+	addr += (snd_pcm_is_capture(stream) ?
 		 NM_RECORD_REG_OFFSET : NM_PLAYBACK_REG_OFFSET);
 
 	if (snd_nm256_readb(chip, poffset) & 1) {
@@ -356,7 +356,7 @@  snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number)
 
 	/* The recording engine uses coefficient values 8-15.  */
 	number &= 7;
-	if (stream == SNDRV_PCM_STREAM_CAPTURE)
+	if (snd_pcm_is_capture(stream))
 		number += 8;
 
 	if (! chip->use_cache) {
@@ -372,7 +372,7 @@  snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number)
 		u32 offset = snd_nm256_get_start_offset(number);
 		u32 end_offset = offset + coefficient_sizes[number];
 		snd_nm256_writel(chip, addr, base + offset);
-		if (stream == SNDRV_PCM_STREAM_PLAYBACK)
+		if (snd_pcm_is_playback(stream))
 			end_offset--;
 		snd_nm256_writel(chip, addr + 4, base + end_offset);
 	}