We can use snd_pcm_is_playback/capture(). Let's use it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/pci/lx6464es/lx6464es.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index bd9b6148dd6fb..721b4ea3103ac 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c @@ -98,7 +98,7 @@ static int lx_hardware_open(struct lx6464es *chip, int err = 0; struct snd_pcm_runtime *runtime = substream->runtime; int channels = runtime->channels; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream);
snd_pcm_uframes_t period_size = runtime->period_size;
@@ -124,7 +124,7 @@ static int lx_hardware_start(struct lx6464es *chip, { int err = 0; struct snd_pcm_runtime *runtime = substream->runtime; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream);
dev_dbg(chip->card->dev, "setting stream format\n"); err = lx_stream_set_format(chip, runtime, 0, is_capture); @@ -155,7 +155,7 @@ static int lx_hardware_stop(struct lx6464es *chip, struct snd_pcm_substream *substream) { int err = 0; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream);
dev_dbg(chip->card->dev, "pausing pipe\n"); err = lx_pipe_pause(chip, 0, is_capture); @@ -186,7 +186,7 @@ static int lx_hardware_close(struct lx6464es *chip, struct snd_pcm_substream *substream) { int err = 0; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream);
dev_dbg(chip->card->dev, "releasing pipe\n"); err = lx_pipe_release(chip, 0, is_capture); @@ -268,7 +268,7 @@ static snd_pcm_uframes_t lx_pcm_stream_pointer(struct snd_pcm_substream { struct lx6464es *chip = snd_pcm_substream_chip(substream); snd_pcm_uframes_t pos; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream);
struct lx_stream *lx_stream = is_capture ? &chip->capture_stream : &chip->playback_stream; @@ -287,7 +287,7 @@ static int lx_pcm_prepare(struct snd_pcm_substream *substream) { struct lx6464es *chip = snd_pcm_substream_chip(substream); int err = 0; - const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + const int is_capture = snd_pcm_is_capture(substream);
dev_dbg(chip->card->dev, "->lx_pcm_prepare\n");
@@ -370,7 +370,7 @@ static int lx_pcm_hw_free(struct snd_pcm_substream *substream) { struct lx6464es *chip = snd_pcm_substream_chip(substream); int err = 0; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream);
dev_dbg(chip->card->dev, "->lx_pcm_hw_free\n"); mutex_lock(&chip->setup_mutex); @@ -515,7 +515,7 @@ static int lx_pcm_trigger_dispatch(struct lx6464es *chip, static int lx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { struct lx6464es *chip = snd_pcm_substream_chip(substream); - const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + const int is_capture = snd_pcm_is_capture(substream); struct lx_stream *stream = is_capture ? &chip->capture_stream : &chip->playback_stream;