From: Mark Brown Date: Wed, 15 Jul 2009 09:36:51 +0000 (+0100) Subject: ASoC: Error out if we can't determine a suitable WM9081 sysclk X-Git-Tag: v2.6.33-rc3~4^2~202^2~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b75e9476737dffef44a66818a4a481edd2512a1;p=platform%2Fkernel%2Flinux-3.10.git ASoC: Error out if we can't determine a suitable WM9081 sysclk Due to the flexibility of the WM9081 FLL this should never happen in a real system. Reported-by: Jaswinder Singh Rajput Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/wm9081.c b/sound/soc/codecs/wm9081.c index dbe2059..156f2a4 100644 --- a/sound/soc/codecs/wm9081.c +++ b/sound/soc/codecs/wm9081.c @@ -707,6 +707,10 @@ static int configure_clock(struct snd_soc_codec *codec) target > 3000000) break; } + + if (i == ARRAY_SIZE(clk_sys_rates)) + return -EINVAL; + } else if (wm9081->fs) { for (i = 0; i < ARRAY_SIZE(clk_sys_rates); i++) { new_sysclk = clk_sys_rates[i].ratio @@ -714,6 +718,10 @@ static int configure_clock(struct snd_soc_codec *codec) if (new_sysclk > 3000000) break; } + + if (i == ARRAY_SIZE(clk_sys_rates)) + return -EINVAL; + } else { new_sysclk = 12288000; }