Skip to content

Commit

Permalink
of/flattree: fix of_flat_dt_is_compatible() to match the full compati…
Browse files Browse the repository at this point in the history
…ble 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>
  • Loading branch information
Stuart Yoder authored and Grant Likely committed Jul 24, 2010
1 parent c0dd394 commit 883c2cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 883c2cf

Please sign in to comment.