We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx> --- sound/soc/apple/mca.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c index 3780aca710769..60a5ecbd5f756 100644 --- a/sound/soc/apple/mca.c +++ b/sound/soc/apple/mca.c @@ -193,7 +193,7 @@ static void mca_fe_early_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct mca_cluster *cl = mca_dai_to_cluster(dai); - bool is_tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_tx = snd_pcm_is_playback(substream); int serdes_unit = is_tx ? CLUSTER_TX_OFF : CLUSTER_RX_OFF; int serdes_conf = serdes_unit + (is_tx ? REG_TX_SERDES_CONF : REG_RX_SERDES_CONF); @@ -230,7 +230,7 @@ static int mca_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct mca_cluster *cl = mca_dai_to_cluster(dai); - bool is_tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_tx = snd_pcm_is_playback(substream); int serdes_unit = is_tx ? CLUSTER_TX_OFF : CLUSTER_RX_OFF; switch (cmd) { @@ -570,7 +570,7 @@ static int mca_fe_hw_params(struct snd_pcm_substream *substream, struct mca_data *mca = cl->host; struct device *dev = mca->dev; unsigned int samp_rate = params_rate(params); - bool is_tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_tx = snd_pcm_is_playback(substream); bool refine_tdm = false; unsigned long bclk_ratio; unsigned int tdm_slots, tdm_slot_width, tdm_mask; @@ -844,7 +844,7 @@ static int mca_hw_params(struct snd_soc_component *component, if (ret < 0) return ret; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) slave_config.dst_port_window_size = min_t(u32, params_channels(params), 4); else @@ -895,7 +895,7 @@ static snd_pcm_uframes_t mca_pointer(struct snd_soc_component *component, static struct dma_chan *mca_request_dma_channel(struct mca_cluster *cl, unsigned int stream) { - bool is_tx = (stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_tx = snd_pcm_is_playback(stream); #ifndef USE_RXB_FOR_CAPTURE char *name = devm_kasprintf(cl->host->dev, GFP_KERNEL, is_tx ? "tx%da" : "rx%da", cl->no); -- 2.43.0