@@ -434,7 +434,7 @@ static void ak4613_hw_constraints(struct ak4613_priv *priv,
unsigned int mask;
unsigned int mode;
unsigned int fs;
- int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+ int is_play = snd_pcm_is_playback(substream);
int sdti_num;
int i;
@@ -739,7 +739,7 @@ static int ak4613_dai_trigger(struct snd_pcm_substream *substream, int cmd,
(cmd != SNDRV_PCM_TRIGGER_RESUME))
return 0;
- if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
+ if (!snd_pcm_is_playback(substream))
return 0;
priv->component = component;
@@ -538,7 +538,7 @@ static int ak4619_dai_hw_params(struct snd_pcm_substream *substream,
unsigned int width;
unsigned int rate;
unsigned int fs;
- bool is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+ bool is_play = snd_pcm_is_playback(substream);
u8 dai_ctrl = 0;
u8 clk_mode = 0;
@@ -344,7 +344,7 @@ static int ak4641_i2s_hw_params(struct snd_pcm_substream *substream,
snd_soc_component_update_bits(component, AK4641_MODE2, (0x3 << 5), mode2);
/* Update de-emphasis filter for the new rate */
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
+ if (snd_pcm_is_playback(substream)) {
ak4641->playback_fs = rate;
ak4641_set_deemph(component);
}
@@ -277,7 +277,7 @@ static const struct reg_default ak4648_reg[] = {
static int ak4642_dai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+ int is_play = snd_pcm_is_playback(substream);
struct snd_soc_component *component = dai->component;
if (is_play) {
@@ -320,7 +320,7 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream,
static void ak4642_dai_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
- int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
+ int is_play = snd_pcm_is_playback(substream);
struct snd_soc_component *component = dai->component;
if (is_play) {
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/ak4613.c | 4 ++-- sound/soc/codecs/ak4619.c | 2 +- sound/soc/codecs/ak4641.c | 2 +- sound/soc/codecs/ak4642.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-)