[PATCH 010/113] ALSA: isa: 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/isa/sb/sb16_main.c | 4 ++--
 sound/isa/sb/sb8_main.c  | 6 +++---
 sound/isa/wss/wss_lib.c  | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c
index a9b87e159b2d1..7145dcb4417a5 100644
--- a/sound/isa/sb/sb16_main.c
+++ b/sound/isa/sb/sb16_main.c
@@ -216,7 +216,7 @@ static void snd_sb16_setup_rate(struct snd_sb *chip,
 	unsigned long flags;
 
 	spin_lock_irqsave(&chip->reg_lock, flags);
-	if (chip->mode & (channel == SNDRV_PCM_STREAM_PLAYBACK ? SB_MODE_PLAYBACK_16 : SB_MODE_CAPTURE_16))
+	if (chip->mode & (snd_pcm_is_playback(channel) ? SB_MODE_PLAYBACK_16 : SB_MODE_CAPTURE_16))
 		snd_sb_ack_16bit(chip);
 	else
 		snd_sb_ack_8bit(chip);
@@ -860,7 +860,7 @@ int snd_sb16dsp_pcm(struct snd_sb *chip, int device)
 
 const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction)
 {
-	return direction == SNDRV_PCM_STREAM_PLAYBACK ?
+	return snd_pcm_is_playback(direction) ?
 		&snd_sb16_playback_ops : &snd_sb16_capture_ops;
 }
 
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c
index 2ed176a5a5743..dbb08e9e0f367 100644
--- a/sound/isa/sb/sb8_main.c
+++ b/sound/isa/sb/sb8_main.c
@@ -473,7 +473,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream)
 	}
 	chip->open |= SB_OPEN_PCM;
 	spin_unlock_irqrestore(&chip->open_lock, flags);
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(substream)) {
 		chip->playback_substream = substream;
 		runtime->hw = snd_sb8_playback;
 	} else {
@@ -501,7 +501,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream)
 				     SNDRV_PCM_HW_PARAM_RATE, -1);
 		break;
 	case SB_HW_201:
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+		if (snd_pcm_is_playback(substream)) {
 			runtime->hw.rate_max = 44100;
 		} else {
 			runtime->hw.rate_max = 15000;
@@ -532,7 +532,7 @@ static int snd_sb8_close(struct snd_pcm_substream *substream)
 	chip->capture_substream = NULL;
 	spin_lock_irqsave(&chip->open_lock, flags);
 	chip->open &= ~SB_OPEN_PCM;
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		chip->mode &= ~SB_MODE_PLAYBACK;
 	else
 		chip->mode &= ~SB_MODE_CAPTURE;
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c
index 026061b55ee94..d3f1a80c3a574 100644
--- a/sound/isa/wss/wss_lib.c
+++ b/sound/isa/wss/wss_lib.c
@@ -2196,7 +2196,7 @@ EXPORT_SYMBOL(snd_wss_mixer);
 
 const struct snd_pcm_ops *snd_wss_get_pcm_ops(int direction)
 {
-	return direction == SNDRV_PCM_STREAM_PLAYBACK ?
+	return snd_pcm_is_playback(direction) ?
 		&snd_wss_playback_ops : &snd_wss_capture_ops;
 }
 EXPORT_SYMBOL(snd_wss_get_pcm_ops);
-- 
2.43.0





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux