[PATCH 086/113] ASoC: codecs: nau882x: use snd_pcm_is_playback/capture()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We can use snd_pcm_is_playback/capture(). Let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
 sound/soc/codecs/nau8821.c | 4 ++--
 sound/soc/codecs/nau8824.c | 4 ++--
 sound/soc/codecs/nau8825.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/nau8821.c b/sound/soc/codecs/nau8821.c
index de5c4db05c8f8..f887c192b87cf 100644
--- a/sound/soc/codecs/nau8821.c
+++ b/sound/soc/codecs/nau8821.c
@@ -803,7 +803,7 @@ nau8821_get_osr(struct nau8821 *nau8821, int stream)
 {
 	unsigned int osr;
 
-	if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(stream)) {
 		regmap_read(nau8821->regmap, NAU8821_R2C_DAC_CTRL1, &osr);
 		osr &= NAU8821_DAC_OVERSAMPLE_MASK;
 		if (osr >= ARRAY_SIZE(osr_dac_sel))
@@ -854,7 +854,7 @@ static int nau8821_hw_params(struct snd_pcm_substream *substream,
 		return -EINVAL;
 	if (nau8821->fs * osr->osr > CLK_DA_AD_MAX)
 		return -EINVAL;
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		regmap_update_bits(nau8821->regmap, NAU8821_R03_CLK_DIVIDER,
 			NAU8821_CLK_DAC_SRC_MASK,
 			osr->clk_src << NAU8821_CLK_DAC_SRC_SFT);
diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c
index 12540397fd4d5..21cda3b473bad 100644
--- a/sound/soc/codecs/nau8824.c
+++ b/sound/soc/codecs/nau8824.c
@@ -1038,7 +1038,7 @@ nau8824_get_osr(struct nau8824 *nau8824, int stream)
 {
 	unsigned int osr;
 
-	if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(stream)) {
 		regmap_read(nau8824->regmap,
 			    NAU8824_REG_DAC_FILTER_CTRL_1, &osr);
 		osr &= NAU8824_DAC_OVERSAMPLE_MASK;
@@ -1094,7 +1094,7 @@ static int nau8824_hw_params(struct snd_pcm_substream *substream,
 		goto error;
 	if (nau8824->fs * osr->osr > CLK_DA_AD_MAX)
 		goto error;
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		regmap_update_bits(nau8824->regmap, NAU8824_REG_CLK_DIVIDER,
 			NAU8824_CLK_DAC_SRC_MASK,
 			osr->clk_src << NAU8824_CLK_DAC_SRC_SFT);
diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index bde25bc6909d5..951406fa5d32f 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1238,7 +1238,7 @@ nau8825_get_osr(struct nau8825 *nau8825, int stream)
 {
 	unsigned int osr;
 
-	if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
+	if (snd_pcm_is_playback(stream)) {
 		regmap_read(nau8825->regmap,
 			    NAU8825_REG_DAC_CTRL1, &osr);
 		osr &= NAU8825_DAC_OVERSAMPLE_MASK;
@@ -1294,7 +1294,7 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream,
 		goto error;
 	if (params_rate(params) * osr->osr > CLK_DA_AD_MAX)
 		goto error;
-	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+	if (snd_pcm_is_playback(substream))
 		regmap_update_bits(nau8825->regmap, NAU8825_REG_CLK_DIVIDER,
 			NAU8825_CLK_DAC_SRC_MASK,
 			osr->clk_src << NAU8825_CLK_DAC_SRC_SFT);
-- 
2.43.0





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux