aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorStuart Yoder <stuart.yoder@freescale.com>2010-07-23 14:42:44 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-07-24 18:51:51 -0400
commit883c2cfc8bcc0fd00c5d9f596fb8870f481b5bda (patch)
tree0023085edc82b242265944865e57a0b31e303980 /drivers/of
parentc0dd394ca5e78649b7013c3ce2d6338af9f228f0 (diff)
of/flattree: fix of_flat_dt_is_compatible() to match the full compatible string
With the current string comparison, a device tree compatible of "foo-bar" would match as compatible with a driver looking for "foo". This patch fixes the function to use the of_compat_cmp() macro so that it does the right thing on all platforms (If sparc ever uses this code, it will still want the strncasecmp() behaviour). Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/fdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index d61fda836e0..dc876cbbd9d 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -169,7 +169,7 @@ int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
169 if (cp == NULL) 169 if (cp == NULL)
170 return 0; 170 return 0;
171 while (cplen > 0) { 171 while (cplen > 0) {
172 if (strncasecmp(cp, compat, strlen(compat)) == 0) 172 if (of_compat_cmp(cp, compat, strlen(compat)) == 0)
173 return 1; 173 return 1;
174 l = strlen(cp) + 1; 174 l = strlen(cp) + 1;
175 cp += l; 175 cp += l;