diff mbox series

[064/113] ASoC: spear: use snd_pcm_is_playback/capture()

Message ID 87jzgvyf7v.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:40 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/spear/spdif_in.c  | 6 +++---
 sound/soc/spear/spdif_out.c | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c
index 4ad8b1fc713a7..fb1b54019194a 100644
--- a/sound/soc/spear/spdif_in.c
+++ b/sound/soc/spear/spdif_in.c
@@ -68,7 +68,7 @@  static void spdif_in_shutdown(struct snd_pcm_substream *substream,
 {
 	struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai);
 
-	if (substream->stream != SNDRV_PCM_STREAM_CAPTURE)
+	if (!snd_pcm_is_capture(substream))
 		return;
 
 	writel(0x0, host->io_base + SPDIF_IN_IRQ_MASK);
@@ -98,7 +98,7 @@  static int spdif_in_hw_params(struct snd_pcm_substream *substream,
 	struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai);
 	u32 format;
 
-	if (substream->stream != SNDRV_PCM_STREAM_CAPTURE)
+	if (!snd_pcm_is_capture(substream))
 		return -EINVAL;
 
 	format = params_format(params);
@@ -114,7 +114,7 @@  static int spdif_in_trigger(struct snd_pcm_substream *substream, int cmd,
 	u32 ctrl;
 	int ret = 0;
 
-	if (substream->stream != SNDRV_PCM_STREAM_CAPTURE)
+	if (!snd_pcm_is_capture(substream))
 		return -EINVAL;
 
 	switch (cmd) {
diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c
index 469373d1bb418..a95a9b9e61e3b 100644
--- a/sound/soc/spear/spdif_out.c
+++ b/sound/soc/spear/spdif_out.c
@@ -63,7 +63,7 @@  static int spdif_out_startup(struct snd_pcm_substream *substream,
 	struct spdif_out_dev *host = snd_soc_dai_get_drvdata(cpu_dai);
 	int ret;
 
-	if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
+	if (!snd_pcm_is_playback(substream))
 		return -EINVAL;
 
 	ret = clk_enable(host->clk);
@@ -81,7 +81,7 @@  static void spdif_out_shutdown(struct snd_pcm_substream *substream,
 {
 	struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai);
 
-	if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
+	if (!snd_pcm_is_playback(substream))
 		return;
 
 	clk_disable(host->clk);
@@ -109,7 +109,7 @@  static int spdif_out_hw_params(struct snd_pcm_substream *substream,
 	struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai);
 	u32 rate, core_freq;
 
-	if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
+	if (!snd_pcm_is_playback(substream))
 		return -EINVAL;
 
 	rate = params_rate(params);
@@ -155,7 +155,7 @@  static int spdif_out_trigger(struct snd_pcm_substream *substream, int cmd,
 	u32 ctrl;
 	int ret = 0;
 
-	if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
+	if (!snd_pcm_is_playback(substream))
 		return -EINVAL;
 
 	switch (cmd) {