ASoC: fsl: using params_width function to simplify code
authorZidan Wang <zidan.wang@freescale.com>
Tue, 24 Nov 2015 07:32:09 +0000 (15:32 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 25 Nov 2015 12:12:57 +0000 (12:12 +0000)
using params_width function to simplify code.

Signed-off-by: Zidan Wang <zidan.wang@freescale.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_asrc.c
sound/soc/fsl/fsl_esai.c
sound/soc/fsl/fsl_sai.c
sound/soc/fsl/fsl_ssi.c

index 9f087d4f73ed775bdfaf9bad8c562b26a657b47d..6d0636605ed25467e00ecc82f44b9f9cb5d28db1 100644 (file)
@@ -447,7 +447,7 @@ static int fsl_asrc_dai_hw_params(struct snd_pcm_substream *substream,
                                  struct snd_soc_dai *dai)
 {
        struct fsl_asrc *asrc_priv = snd_soc_dai_get_drvdata(dai);
-       int width = snd_pcm_format_width(params_format(params));
+       int width = params_width(params);
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct fsl_asrc_pair *pair = runtime->private_data;
        unsigned int channels = params_channels(params);
index 504e7318f225c2f4df7fa711d565f2dde3c129bd..45d4319b2079d1bf83c7bcfada850061809b0396 100644 (file)
@@ -510,7 +510,7 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream,
 {
        struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai);
        bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
-       u32 width = snd_pcm_format_width(params_format(params));
+       u32 width = params_width(params);
        u32 channels = params_channels(params);
        u32 pins = DIV_ROUND_UP(channels, esai_priv->slots);
        u32 slot_width = width;
index dc0cc65406f552b2c31f40fe1c5bcd3b6401f242..3da278313591d397c2ece80199779a7b86bfbb01 100644 (file)
@@ -404,7 +404,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
        struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
        bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
        unsigned int channels = params_channels(params);
-       u32 word_width = snd_pcm_format_width(params_format(params));
+       u32 word_width = params_width(params);
        u32 val_cr4 = 0, val_cr5 = 0;
        u32 slots = (channels == 1) ? 2 : channels;
        u32 slot_width = word_width;
index 674abf778715e0ac01c73f873b9429cef83959e7..e3abad5f980a5b958522ba92cb312ee77fe27a8e 100644 (file)
@@ -767,8 +767,7 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream,
        struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(cpu_dai);
        struct regmap *regs = ssi_private->regs;
        unsigned int channels = params_channels(hw_params);
-       unsigned int sample_size =
-               snd_pcm_format_width(params_format(hw_params));
+       unsigned int sample_size = params_width(hw_params);
        u32 wl = CCSR_SSI_SxCCR_WL(sample_size);
        int ret;
        u32 scr_val;