diff mbox series

[105/113] ASoC: samsung: use snd_pcm_is_playback/capture()

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

Commit Message

Kuninori Morimoto Aug. 5, 2024, 12:44 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/soc/samsung/i2s.c   | 8 ++++----
 sound/soc/samsung/pcm.c   | 4 ++--
 sound/soc/samsung/spdif.c | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 1bcabb114e29f..fdf494a49dd92 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -744,13 +744,13 @@  static int i2s_hw_params(struct snd_pcm_substream *substream,
 		val |= MOD_DC1_EN;
 		break;
 	case 2:
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		if (snd_pcm_is_playback(substream))
 			i2s->dma_playback.addr_width = 4;
 		else
 			i2s->dma_capture.addr_width = 4;
 		break;
 	case 1:
-		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+		if (snd_pcm_is_playback(substream))
 			i2s->dma_playback.addr_width = 2;
 		else
 			i2s->dma_capture.addr_width = 2;
@@ -936,7 +936,7 @@  static int i2s_trigger(struct snd_pcm_substream *substream,
 	int cmd, struct snd_soc_dai *dai)
 {
 	struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai);
-	int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE);
+	int capture = snd_pcm_is_capture(substream);
 	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
 	struct i2s_dai *i2s = to_info(snd_soc_rtd_to_cpu(rtd, 0));
 	unsigned long flags;
@@ -1026,7 +1026,7 @@  i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
 
 	WARN_ON(!pm_runtime_active(dai->dev));
 
-	if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+	if (snd_pcm_is_capture(substream))
 		delay = FIC_RXCOUNT(reg);
 	else if (is_secondary(i2s))
 		delay = FICS_TXCOUNT(readl(priv->addr + I2SFICS));
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c
index 573b2dee7f07c..a9bcc2adb4403 100644
--- a/sound/soc/samsung/pcm.c
+++ b/sound/soc/samsung/pcm.c
@@ -228,7 +228,7 @@  static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
 	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
 		spin_lock_irqsave(&pcm->lock, flags);
 
-		if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+		if (snd_pcm_is_capture(substream))
 			s3c_pcm_snd_rxctrl(pcm, 1);
 		else
 			s3c_pcm_snd_txctrl(pcm, 1);
@@ -241,7 +241,7 @@  static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
 	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
 		spin_lock_irqsave(&pcm->lock, flags);
 
-		if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+		if (snd_pcm_is_capture(substream))
 			s3c_pcm_snd_rxctrl(pcm, 0);
 		else
 			s3c_pcm_snd_txctrl(pcm, 0);
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index f44e3180e8d3d..d5eaeacefd230 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -187,7 +187,7 @@  static int spdif_hw_params(struct snd_pcm_substream *substream,
 
 	dev_dbg(spdif->dev, "Entered %s\n", __func__);
 
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		dma_data = spdif->dma_playback;
 	else {
 		dev_err(spdif->dev, "Capture is not supported\n");