diff mbox series

[037/113] ALSA: firewire: dice: use snd_pcm_is_playback/capture()

Message ID 87mslrztw2.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:38 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/firewire/dice/dice-pcm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c
index d64366217d572..063e16d153fa5 100644
--- a/sound/firewire/dice/dice-pcm.c
+++ b/sound/firewire/dice/dice-pcm.c
@@ -26,7 +26,7 @@  static int dice_rate_constraint(struct snd_pcm_hw_params *params,
 	enum snd_dice_rate_mode mode;
 	unsigned int i, rate;
 
-	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+	if (snd_pcm_is_capture(substream))
 		pcm_channels = dice->tx_pcm_chs[index];
 	else
 		pcm_channels = dice->rx_pcm_chs[index];
@@ -64,7 +64,7 @@  static int dice_channels_constraint(struct snd_pcm_hw_params *params,
 	enum snd_dice_rate_mode mode;
 	unsigned int i, rate;
 
-	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+	if (snd_pcm_is_capture(substream))
 		pcm_channels = dice->tx_pcm_chs[index];
 	else
 		pcm_channels = dice->rx_pcm_chs[index];
@@ -132,7 +132,7 @@  static int init_hw_info(struct snd_dice *dice,
 	struct amdtp_stream *stream;
 	int err;
 
-	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
+	if (snd_pcm_is_capture(substream)) {
 		hw->formats = AM824_IN_PCM_FORMAT_BITS;
 		dir = AMDTP_IN_STREAM;
 		stream = &dice->tx_stream[index];