]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ASoC: cht_bsw_rt5672: Use snd_pcm_hw_constraint_single()
authorLars-Peter Clausen <lars@metafoo.de>
Sun, 18 Oct 2015 13:39:33 +0000 (15:39 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 21 Oct 2015 12:26:23 +0000 (14:26 +0200)
Use the new snd_pcm_hw_constraint_single() helper function rather than
installing a list constraint with a single value. Since
snd_pcm_hw_constraint_single() sets a static constraint while
snd_pcm_hw_constraint_list() sets a dynamic constraint the former is
slightly more efficient and it also needs less code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/soc/intel/boards/cht_bsw_rt5672.c

index 23fe0407514209d2ddfd67b7e076f099c5e73f5d..5621ccd92992d9f198bd5d0fd6149f06d0a3631a 100644 (file)
@@ -222,20 +222,10 @@ static int cht_codec_fixup(struct snd_soc_pcm_runtime *rtd,
        return 0;
 }
 
-static unsigned int rates_48000[] = {
-       48000,
-};
-
-static struct snd_pcm_hw_constraint_list constraints_48000 = {
-       .count = ARRAY_SIZE(rates_48000),
-       .list  = rates_48000,
-};
-
 static int cht_aif1_startup(struct snd_pcm_substream *substream)
 {
-       return snd_pcm_hw_constraint_list(substream->runtime, 0,
-                       SNDRV_PCM_HW_PARAM_RATE,
-                       &constraints_48000);
+       return snd_pcm_hw_constraint_single(substream->runtime,
+                       SNDRV_PCM_HW_PARAM_RATE, 48000);
 }
 
 static struct snd_soc_ops cht_aif1_ops = {