We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx> --- sound/pci/pcxhr/pcxhr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 242bd7e04b3e1..2de8ccb33d17e 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -626,7 +626,7 @@ static int pcxhr_update_r_buffer(struct pcxhr_stream *stream) struct snd_pcm_substream *subs = stream->substream; struct snd_pcxhr *chip = snd_pcm_substream_chip(subs); - is_capture = (subs->stream == SNDRV_PCM_STREAM_CAPTURE); + is_capture = snd_pcm_is_capture(subs); stream_num = is_capture ? 0 : subs->number; dev_dbg(chip->card->dev, @@ -995,7 +995,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs) /* copy the struct snd_pcm_hardware struct */ runtime->hw = pcxhr_caps; - if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) { + if(snd_pcm_is_playback(subs)) { dev_dbg(chip->card->dev, "%s playback chip%d subs%d\n", __func__, chip->chip_idx, subs->number); stream = &chip->playback_stream[subs->number]; -- 2.43.0