summaryrefslogtreecommitdiff
path: root/drivers/of/base.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-07-22 01:07:33 +0400
committerArnd Bergmann <arnd@arndb.de>2012-07-22 01:07:33 +0400
commit608f593b1313080301b76875487af6da508f67a1 (patch)
treeb775454cd4d1d380134c2d91ff79d0375987dc64 /drivers/of/base.c
parenta1acbbf4adcd346f12fc567143eac90ef33f29b0 (diff)
parent84a1caf1453c3d44050bd22db958af4a7f99315c (diff)
downloadlinux-608f593b1313080301b76875487af6da508f67a1.tar.xz
Merge tag 'v3.5-rc7' into next/boards
Linux 3.5-rc7 Prerequisite for samsung/board3 branch. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r--drivers/of/base.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index eada3f4ef801..d9bfd49b1935 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -511,22 +511,6 @@ out:
}
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
@@ -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])
@@ -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++;
}