From: Richard Fitzgerald Date: Wed, 16 Dec 2015 17:06:24 +0000 (+0000) Subject: ASoC: arizona: In arizona_calc_fratio make new codecs the default case X-Git-Tag: v4.5-rc1~20^2~24^2~11^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3451eb485aee78f31a8dd127e3385f89946c813b;p=platform%2Fkernel%2Flinux-exynos.git ASoC: arizona: In arizona_calc_fratio make new codecs the default case This patch rearranges the switch statement in arizona_calc_fratio so that older codecs are the special cases, with the default case applying to newer codecs (WM8998 and later). This is preferable because it avoids having to patch new cases in every time a new codec is added. Signed-off-by: Richard Fitzgerald Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c index d90b3c5..38a73e3 100644 --- a/sound/soc/codecs/arizona.c +++ b/sound/soc/codecs/arizona.c @@ -2020,18 +2020,18 @@ static int arizona_calc_fratio(struct arizona_fll *fll, } switch (fll->arizona->type) { + case WM5102: + case WM8997: + return init_ratio; case WM5110: case WM8280: if (fll->arizona->rev < 3 || sync) return init_ratio; break; - case WM8998: - case WM1814: + default: if (sync) return init_ratio; break; - default: - return init_ratio; } cfg->fratio = init_ratio - 1;