]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: max9867: Changed the if-else case to switch case
authoranish kumar <yesanishhere@gmail.com>
Thu, 18 Feb 2016 18:36:20 +0000 (10:36 -0800)
committerMark Brown <broonie@kernel.org>
Thu, 18 Feb 2016 20:19:31 +0000 (20:19 +0000)
Signed-off-by: anish kumar <yesanishhere@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/max9867.c

index b9d989f25515533583c74daed2d03c1b97b6796b..5a8481bf20c23be03332bcfbea6c92855bfd39ef 100755 (executable)
@@ -212,16 +212,22 @@ static int max9867_dai_hw_params(struct snd_pcm_substream *substream,
                switch (snd_pcm_format_width(params_format(params))) {
                case 8:
                case 16:
-                       if (pclk_bclk_ratio == 2)
+                       switch (pclk_bclk_ratio) {
+                       case 2:
                                bclk_value = MAX9867_IFC1B_PCLK_2;
-                       else if (pclk_bclk_ratio == 4)
+                               break;
+                       case 4:
                                bclk_value = MAX9867_IFC1B_PCLK_4;
-                       else if (pclk_bclk_ratio == 8)
+                               break;
+                       case 8:
                                bclk_value = MAX9867_IFC1B_PCLK_8;
-                       else if (pclk_bclk_ratio == 16)
+                               break;
+                       case 16:
                                bclk_value = MAX9867_IFC1B_PCLK_16;
-                       else {
-                               dev_err(codec->dev, "unsupported sampling rate\n");
+                               break;
+                       default:
+                               dev_err(codec->dev,
+                                       "unsupported sampling rate\n");
                                return -EINVAL;
                        }
                        break;