diff options
author | viresh kumar <viresh.linux@gmail.com> | 2010-03-09 05:54:30 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-03-19 12:58:51 -0400 |
commit | e4bf5becccf4685754c4d8e4485bb2ff7d28147f (patch) | |
tree | e7a9791e41a86374d3bf061a305cb5e115283744 /arch/arm/common/clkdev.c | |
parent | 0deac0bf66110fe70507c5dcec661c9e85fa07ca (diff) |
ARM: 5979/1: CLKDEV: return from clk_find as soon as we get maching clk
clk_find function looks for clock with matching dev_id and con_id.
We should return from clk_find as soon as we get a clock with matching
dev_id and con_id. This can be done by comparing variable "match" with 3.
Acked-by: Uwe Kleine-Konig <u.kleine-koenig@pengutronix.de>
Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common/clkdev.c')
-rw-r--r-- | arch/arm/common/clkdev.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/common/clkdev.c b/arch/arm/common/clkdev.c index 6416d5b5020d..4f8390dd6cac 100644 --- a/arch/arm/common/clkdev.c +++ b/arch/arm/common/clkdev.c | |||
@@ -52,12 +52,13 @@ static struct clk *clk_find(const char *dev_id, const char *con_id) | |||
52 | continue; | 52 | continue; |
53 | match += 1; | 53 | match += 1; |
54 | } | 54 | } |
55 | if (match == 0) | ||
56 | continue; | ||
57 | 55 | ||
58 | if (match > best) { | 56 | if (match > best) { |
59 | clk = p->clk; | 57 | clk = p->clk; |
60 | best = match; | 58 | if (match != 3) |
59 | best = match; | ||
60 | else | ||
61 | break; | ||
61 | } | 62 | } |
62 | } | 63 | } |
63 | return clk; | 64 | return clk; |