ASoC: arizona: Do not test ratio zero as it is not a valid setting
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Wed, 9 Jul 2014 16:41:43 +0000 (17:41 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 10 Jul 2014 10:09:14 +0000 (12:09 +0200)
Zero is not a valid FRATIO for the FLL, as such we shouldn't test it
whilst refining the FRATIO. This patch does just that.

Reported-by: Ryo Tsutsui <ryo.tsutsui@wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/arizona.c

index 41b56ee..b03974e 100644 (file)
@@ -1585,7 +1585,7 @@ static int arizona_calc_fratio(struct arizona_fll *fll,
                        }
                }
 
-               for (ratio = init_ratio - 1; ratio >= 0; ratio--) {
+               for (ratio = init_ratio - 1; ratio > 0; ratio--) {
                        if (ARIZONA_FLL_VCO_CORNER / (fll->vco_mult * ratio) <
                            Fref)
                                break;