]> git.baikalelectronics.ru Git - kernel.git/commit
of: Fix comparison of "compatible" properties
authorGrant Likely <grant.likely@secretlab.ca>
Thu, 18 Mar 2010 13:30:31 +0000 (07:30 -0600)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 18 Mar 2010 13:30:31 +0000 (07:30 -0600)
commitd854bb2f9edc2db707c5174eb28f2735cc82cdfa
treec6957ba400864cedef592969b520bbb21510e3c1
parenta6741e7c605fc95f443984e54a189cfd61a81d77
of: Fix comparison of "compatible" properties

Commit c93804baaf84a6297a77fb87e620b16f002593d1
"of: put default string compare and #a/s-cell values into common header"

Breaks various things on powerpc due to using strncasecmp instead of
strcasecmp for comparing against "compatible" strings.

This causes things like the 4xx PCI code to fail miserably due to the
partial matches in code like this:

       for_each_compatible_node(np, NULL, "ibm,plb-pcix")
               ppc4xx_probe_pcix_bridge(np);
       for_each_compatible_node(np, NULL, "ibm,plb-pci")
               ppc4xx_probe_pci_bridge(np);

It's not quite right to do partial name match. Entries in a compatible
list are meant to be matched whole. If a device is compatible with both
"foo" and "foo1", then the device should have both strings in its
"compatible" property.

This patch reverts powerpc and microblaze us to use strcasecmp.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      (for patch description)
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Michal Simek <michal.simek@petalogix.com>
include/linux/of.h