Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311758
b: refs/heads/master
c: 310959e
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jul 10, 2012
1 parent 3c7b838 commit faab65b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 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: 50fb31cfed9218b439360caf7c0399b00042da15
refs/heads/master: 310959e831783d220d1fcaaca90e17c923830ed6
30 changes: 4 additions & 26 deletions trunk/drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,22 +511,6 @@ struct device_node *of_find_node_with_property(struct device_node *from,
}
EXPORT_SYMBOL(of_find_node_with_property);

static const struct of_device_id *of_match_compat(const struct of_device_id *matches,
const char *compat)
{
while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
const char *cp = matches->compatible;
int len = strlen(cp);

if (len > 0 && of_compat_cmp(compat, cp, len) == 0)
return matches;

matches++;
}

return NULL;
}

/**
* of_match_node - Tell if an device_node has a matching of_match structure
* @matches: array of of device match structures to search in
Expand All @@ -537,18 +521,9 @@ static const struct of_device_id *of_match_compat(const struct of_device_id *mat
const struct of_device_id *of_match_node(const struct of_device_id *matches,
const struct device_node *node)
{
struct property *prop;
const char *cp;

if (!matches)
return NULL;

of_property_for_each_string(node, "compatible", prop, cp) {
const struct of_device_id *match = of_match_compat(matches, cp);
if (match)
return match;
}

while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
int match = 1;
if (matches->name[0])
Expand All @@ -557,7 +532,10 @@ const struct of_device_id *of_match_node(const struct of_device_id *matches,
if (matches->type[0])
match &= node->type
&& !strcmp(matches->type, node->type);
if (match && !matches->compatible[0])
if (matches->compatible[0])
match &= of_device_is_compatible(node,
matches->compatible);
if (match)
return matches;
matches++;
}
Expand Down

0 comments on commit faab65b

Please sign in to comment.