diff mbox series

[021/113] ALSA: pci: mixart: use snd_pcm_is_playback/capture()

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

Commit Message

Kuninori Morimoto Aug. 5, 2024, 12:36 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/mixart/mixart.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

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 */
 		}