All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] CLKDEV: return from clk_find as soon as we get maching clk
@ 2010-03-03  6:48 Viresh KUMAR
  2010-03-03 10:33 ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh KUMAR @ 2010-03-03  6:48 UTC (permalink / raw)
  To: linux-arm-kernel

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.

v2:
	- remove if (match == 0), check.
	- move match==3 in if (match > best) condition

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 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 aae5bc0..efd53f7 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)
 				continue;
 			match += 1;
 		}
-		if (match == 0)
-			continue;
 
 		if (match > best) {
 			clk = p->clk;
-			best = match;
+			if (match != 3)
+				best = match;
+			else
+				break;
 		}
 	}
 	return clk;
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-04  9:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-03  6:48 [PATCH v2] CLKDEV: return from clk_find as soon as we get maching clk Viresh KUMAR
2010-03-03 10:33 ` Uwe Kleine-König
2010-03-03 12:01   ` Viresh KUMAR
2010-03-04  9:29     ` Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.