From 883c2cfc8bcc0fd00c5d9f596fb8870f481b5bda Mon Sep 17 00:00:00 2001 From: Stuart Yoder Date: Fri, 23 Jul 2010 13:42:44 -0500 Subject: 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 Signed-off-by: Grant Likely --- drivers/of/fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/of/fdt.c') 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) if (cp == NULL) return 0; while (cplen > 0) { - if (strncasecmp(cp, compat, strlen(compat)) == 0) + if (of_compat_cmp(cp, compat, strlen(compat)) == 0) return 1; l = strlen(cp) + 1; cp += l; -- cgit v1.2.3-18-g5258