We can use snd_pcm_is_playback/capture(). Let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/cirrus/ep93xx-i2s.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c index 522de4b802939..cb652b273b7e7 100644 --- a/sound/soc/cirrus/ep93xx-i2s.c +++ b/sound/soc/cirrus/ep93xx-i2s.c @@ -121,7 +121,7 @@ static void ep93xx_i2s_enable(struct ep93xx_i2s_info *info, int stream) }
/* Enable fifo */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) base_reg = EP93XX_I2S_TX0EN; else base_reg = EP93XX_I2S_RX0EN; @@ -129,7 +129,7 @@ static void ep93xx_i2s_enable(struct ep93xx_i2s_info *info, int stream)
/* Enable TX IRQs (FIFO empty or underflow) */ if (IS_ENABLED(CONFIG_SND_EP93XX_SOC_I2S_WATCHDOG) && - stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(stream)) ep93xx_i2s_write_reg(info, EP93XX_I2S_TXCTRL, EP93XX_I2S_TXCTRL_TXEMPTY_LVL | EP93XX_I2S_TXCTRL_TXUFIE); @@ -141,11 +141,11 @@ static void ep93xx_i2s_disable(struct ep93xx_i2s_info *info, int stream)
/* Disable IRQs */ if (IS_ENABLED(CONFIG_SND_EP93XX_SOC_I2S_WATCHDOG) && - stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(stream)) ep93xx_i2s_write_reg(info, EP93XX_I2S_TXCTRL, 0);
/* Disable fifo */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) base_reg = EP93XX_I2S_TX0EN; else base_reg = EP93XX_I2S_RX0EN; @@ -328,7 +328,7 @@ static int ep93xx_i2s_hw_params(struct snd_pcm_substream *substream, return -EINVAL; }
- if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ep93xx_i2s_write_reg(info, EP93XX_I2S_TXWRDLEN, word_len); else ep93xx_i2s_write_reg(info, EP93XX_I2S_RXWRDLEN, word_len);