aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2012-12-20 03:53:16 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-12-24 11:02:19 -0500
commit3271a4fc7daeb489bfe1730023c166065e6fb0e7 (patch)
tree13d8c60aae948308e13cf05b84a8dd526897c50f /sound
parenta49f0d1ea3ec94fc7cf33a7c36a16343b74bd565 (diff)
ASoC: cs42l52: Catch no-match case in cs42l52_get_clk
In the case of no-match, return -EINVAL instead of 0. Since we assign i to ret in the for loop, ret always less than ARRAY_SIZE(clk_map_table). Thus remove the boundary checking for ret. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/cs42l52.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c
index 99bb1c69499e..9811a5478c87 100644
--- a/sound/soc/codecs/cs42l52.c
+++ b/sound/soc/codecs/cs42l52.c
@@ -737,7 +737,7 @@ static const struct cs42l52_clk_para clk_map_table[] = {
737 737
738static int cs42l52_get_clk(int mclk, int rate) 738static int cs42l52_get_clk(int mclk, int rate)
739{ 739{
740 int i, ret = 0; 740 int i, ret = -EINVAL;
741 u_int mclk1, mclk2 = 0; 741 u_int mclk1, mclk2 = 0;
742 742
743 for (i = 0; i < ARRAY_SIZE(clk_map_table); i++) { 743 for (i = 0; i < ARRAY_SIZE(clk_map_table); i++) {
@@ -749,8 +749,6 @@ static int cs42l52_get_clk(int mclk, int rate)
749 } 749 }
750 } 750 }
751 } 751 }
752 if (ret > ARRAY_SIZE(clk_map_table))
753 return -EINVAL;
754 return ret; 752 return ret;
755} 753}
756 754