diff options
author | anish kumar <yesanishhere@gmail.com> | 2016-02-18 10:36:20 -0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-02-18 20:19:31 +0000 |
commit | b14614502908beb5d898a665b40cfa91ad237f93 (patch) | |
tree | 17376b6baaf627bb888a2e05ec86e6b6a4d2dd9e /sound/soc/codecs | |
parent | 805d132dcbbdbdf8339008f4f964490cf6ff3025 (diff) | |
download | op-kernel-dev-b14614502908beb5d898a665b40cfa91ad237f93.zip op-kernel-dev-b14614502908beb5d898a665b40cfa91ad237f93.tar.gz |
ASoC: max9867: Changed the if-else case to switch case
Signed-off-by: anish kumar <yesanishhere@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rwxr-xr-x | sound/soc/codecs/max9867.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sound/soc/codecs/max9867.c b/sound/soc/codecs/max9867.c index b9d989f..5a8481b 100755 --- a/sound/soc/codecs/max9867.c +++ b/sound/soc/codecs/max9867.c @@ -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; |