Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130239
b: refs/heads/master
c: 409dc36
h: refs/heads/master
i:
  130237: 77e94b3
  130235: 995164b
  130231: 080962f
  130223: 63ea3d5
  130207: b37ebf4
  130175: 84f8b34
v: v3
  • Loading branch information
Russell King authored and Russell King committed Jan 24, 2009
1 parent c63640a commit a447147
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 02e0746ecc0e72482fe6f350cbb8b65d1d5fc40a
refs/heads/master: 409dc360b49480b57869ffd457e4b95901b76b75
25 changes: 19 additions & 6 deletions trunk/arch/arm/common/clkdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,33 @@
static LIST_HEAD(clocks);
static DEFINE_MUTEX(clocks_mutex);

/*
* Find the correct struct clk for the device and connection ID.
* We do slightly fuzzy matching here:
* An entry with a NULL ID is assumed to be a wildcard.
* If an entry has a device ID, it must match
* If an entry has a connection ID, it must match
* Then we take the most specific entry - with the following
* order of precidence: dev+con > dev only > con only.
*/
static struct clk *clk_find(const char *dev_id, const char *con_id)
{
struct clk_lookup *p;
struct clk *clk = NULL;
int match, best = 0;

list_for_each_entry(p, &clocks, node) {
if ((p->dev_id && !dev_id) || (p->con_id && !con_id))
continue;
match = 0;
if (p->dev_id)
match += 2 * (strcmp(p->dev_id, dev_id) == 0);
if (p->con_id)
match += 1 * (strcmp(p->con_id, con_id) == 0);
if (p->dev_id) {
if (!dev_id || strcmp(p->dev_id, dev_id))
continue;
match += 2;
}
if (p->con_id) {
if (!con_id || strcmp(p->con_id, con_id))
continue;
match += 1;
}
if (match == 0)
continue;

Expand Down

0 comments on commit a447147

Please sign in to comment.