We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx> --- sound/soc/stm/stm32_i2s.c | 2 +- sound/soc/stm/stm32_sai_sub.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index a96aa308681a2..d6654fc9f1a7c 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -813,7 +813,7 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *cpu_dai) { struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai); - bool playback_flg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool playback_flg = snd_pcm_is_playback(substream); u32 cfg1_mask, ier; int ret; diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index ad2492efb1cdc..ff8d98e574f2b 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -38,8 +38,8 @@ #define STM_SAI_DAI_NAME_SIZE 15 -#define STM_SAI_IS_PLAYBACK(ip) ((ip)->dir == SNDRV_PCM_STREAM_PLAYBACK) -#define STM_SAI_IS_CAPTURE(ip) ((ip)->dir == SNDRV_PCM_STREAM_CAPTURE) +#define STM_SAI_IS_PLAYBACK(ip) snd_pcm_is_playback((ip)->dir) +#define STM_SAI_IS_CAPTURE(ip) snd_pcm_is_capture((ip)->dir) #define STM_SAI_A_ID 0x0 #define STM_SAI_B_ID 0x1 @@ -1406,7 +1406,7 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, sai->spdif = false; if (of_property_present(np, "st,iec60958")) { if (!STM_SAI_HAS_SPDIF(sai) || - sai->dir == SNDRV_PCM_STREAM_CAPTURE) { + STM_SAI_IS_CAPTURE(sai)) { dev_err(&pdev->dev, "S/PDIF IEC60958 not supported\n"); return -EINVAL; } -- 2.43.0