[PATCH 021/113] ALSA: pci: mixart: 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/pci/mixart/mixart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 7ceaf6a7a77ea..ed4959c517d2d 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -391,7 +391,7 @@ static int mixart_set_stream_state(struct mixart_stream *stream, int start)
 	stream_state_req.stream_info.stream_desc.uid_pipe = stream->pipe->group_uid;
 	stream_state_req.stream_info.stream_desc.stream_idx = stream->substream->number;
 
-	if (stream->substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(stream->substream))
 		request.message_id = start ? MSG_STREAM_START_INPUT_STAGE_PACKET : MSG_STREAM_STOP_INPUT_STAGE_PACKET;
 	else
 		request.message_id = start ? MSG_STREAM_START_OUTPUT_STAGE_PACKET : MSG_STREAM_STOP_OUTPUT_STAGE_PACKET;
@@ -608,7 +608,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
 	/* update the stream levels */
 	if( stream->pcm_number <= MIXART_PCM_DIGITAL ) {
 		int is_aes = stream->pcm_number > MIXART_PCM_ANALOG;
-		if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK )
+		if(snd_pcm_is_playback(subs))
 			mixart_update_playback_stream_level(chip, is_aes, subs->number);
 		else
 			mixart_update_capture_stream_level( chip, is_aes);
@@ -626,7 +626,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
 	if (subs->runtime->buffer_changed) {
 		struct mixart_bufferinfo *bufferinfo;
 		int i = (chip->chip_idx * MIXART_MAX_STREAM_PER_CARD) + (stream->pcm_number * (MIXART_PLAYBACK_STREAMS+MIXART_CAPTURE_STREAMS)) + subs->number;
-		if( subs->stream == SNDRV_PCM_STREAM_CAPTURE ) {
+		if(snd_pcm_is_capture(subs)) {
 			i += MIXART_PLAYBACK_STREAMS; /* in array capture is behind playback */
 		}
 		
-- 
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