Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tegra', 'asoc/topic...
[linux-2.6-microblaze.git] / sound / soc / codecs / tlv320aic31xx.c
index 6cd5f50..dc3223d 100644 (file)
@@ -911,12 +911,13 @@ static int aic31xx_set_dai_sysclk(struct snd_soc_dai *codec_dai,
        }
        aic31xx->p_div = i;
 
-       for (i = 0; aic31xx_divs[i].mclk_p != freq/aic31xx->p_div; i++) {
-               if (i == ARRAY_SIZE(aic31xx_divs)) {
-                       dev_err(aic31xx->dev, "%s: Unsupported frequency %d\n",
-                               __func__, freq);
-                       return -EINVAL;
-               }
+       for (i = 0; i < ARRAY_SIZE(aic31xx_divs) &&
+                    aic31xx_divs[i].mclk_p != freq/aic31xx->p_div; i++)
+               ;
+       if (i == ARRAY_SIZE(aic31xx_divs)) {
+               dev_err(aic31xx->dev, "%s: Unsupported frequency %d\n",
+                       __func__, freq);
+               return -EINVAL;
        }
 
        /* set clock on MCLK, BCLK, or GPIO1 as PLL input */