@@ -270,9 +270,9 @@ static int mt6351_codec_dai_hw_params(struct snd_pcm_substream *substream,
dev_dbg(priv->dev, "%s(), substream->stream %d, rate %d\n",
__func__, substream->stream, rate);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(substream))
priv->dl_rate = rate;
- else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+ else if (snd_pcm_is_capture(substream))
priv->ul_rate = rate;
return 0;
@@ -2363,9 +2363,9 @@ static int mt6358_codec_dai_hw_params(struct snd_pcm_substream *substream,
rate,
substream->number);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(substream))
priv->dl_rate = rate;
- else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+ else if (snd_pcm_is_capture(substream))
priv->ul_rate = rate;
return 0;
@@ -2653,9 +2653,9 @@ static int mt6359_codec_dai_hw_params(struct snd_pcm_substream *substream,
dev_dbg(priv->dev, "%s(), id %d, substream->stream %d, rate %d, number %d\n",
__func__, id, substream->stream, rate, substream->number);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(substream))
priv->dl_rate[id] = rate;
- else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+ else if (snd_pcm_is_capture(substream))
priv->ul_rate[id] = rate;
return 0;
@@ -2668,9 +2668,9 @@ static int mt6359_codec_dai_startup(struct snd_pcm_substream *substream,
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
dev_dbg(priv->dev, "%s stream %d\n", __func__, substream->stream);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(substream))
mt6359_set_playback_gpio(priv);
- else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+ else if (snd_pcm_is_capture(substream))
mt6359_set_capture_gpio(priv);
return 0;
@@ -2683,9 +2683,9 @@ static void mt6359_codec_dai_shutdown(struct snd_pcm_substream *substream,
struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt);
dev_dbg(priv->dev, "%s stream %d\n", __func__, substream->stream);
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+ if (snd_pcm_is_playback(substream))
mt6359_reset_playback_gpio(priv);
- else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+ else if (snd_pcm_is_capture(substream))
mt6359_reset_capture_gpio(priv);
}
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/mt6351.c | 4 ++-- sound/soc/codecs/mt6358.c | 4 ++-- sound/soc/codecs/mt6359.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-)