diff mbox series

[102/113] ASoC: codecs: hdmi-codec: use snd_pcm_is_playback/capture()

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

Commit Message

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

Patch

diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 74caae52e1273..f8a4a1b62698e 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -428,7 +428,7 @@  static int hdmi_codec_startup(struct snd_pcm_substream *substream,
 			      struct snd_soc_dai *dai)
 {
 	struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
-	bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+	bool tx = snd_pcm_is_playback(substream);
 	bool has_capture = !hcp->hcd.no_i2s_capture;
 	bool has_playback = !hcp->hcd.no_i2s_playback;
 	int ret = 0;
@@ -474,7 +474,7 @@  static void hdmi_codec_shutdown(struct snd_pcm_substream *substream,
 				struct snd_soc_dai *dai)
 {
 	struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai);
-	bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+	bool tx = snd_pcm_is_playback(substream);
 	bool has_capture = !hcp->hcd.no_i2s_capture;
 	bool has_playback = !hcp->hcd.no_i2s_playback;
 
@@ -699,7 +699,7 @@  static int hdmi_codec_mute(struct snd_soc_dai *dai, int mute, int direction)
 	 *	snd_soc_dai_digital_mute()
 	 */
 	if (hcp->hcd.ops->mute_stream &&
-	    (direction == SNDRV_PCM_STREAM_PLAYBACK ||
+	    (snd_pcm_is_playback(direction) ||
 	     !hcp->hcd.ops->no_capture_mute))
 		return hcp->hcd.ops->mute_stream(dai->dev->parent,
 						 hcp->hcd.data,