diff options
Diffstat (limited to 'drivers/clk/clkdev.c')
-rw-r--r-- | drivers/clk/clkdev.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index a9a113782821..d4a59931e75e 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c | |||
@@ -35,7 +35,12 @@ static DEFINE_MUTEX(clocks_mutex); | |||
35 | static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) | 35 | static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) |
36 | { | 36 | { |
37 | struct clk_lookup *p, *cl = NULL; | 37 | struct clk_lookup *p, *cl = NULL; |
38 | int match, best = 0; | 38 | int match, best_found = 0, best_possible = 0; |
39 | |||
40 | if (dev_id) | ||
41 | best_possible += 2; | ||
42 | if (con_id) | ||
43 | best_possible += 1; | ||
39 | 44 | ||
40 | list_for_each_entry(p, &clocks, node) { | 45 | list_for_each_entry(p, &clocks, node) { |
41 | match = 0; | 46 | match = 0; |
@@ -50,10 +55,10 @@ static struct clk_lookup *clk_find(const char *dev_id, const char *con_id) | |||
50 | match += 1; | 55 | match += 1; |
51 | } | 56 | } |
52 | 57 | ||
53 | if (match > best) { | 58 | if (match > best_found) { |
54 | cl = p; | 59 | cl = p; |
55 | if (match != 3) | 60 | if (match != best_possible) |
56 | best = match; | 61 | best_found = match; |
57 | else | 62 | else |
58 | break; | 63 | break; |
59 | } | 64 | } |