Revert "OF: base: match each node compatible against all given matches first"
authorKevin Hao <haokexin@gmail.com>
Fri, 14 Feb 2014 05:22:45 +0000 (13:22 +0800)
committerRob Herring <robh@kernel.org>
Fri, 14 Feb 2014 19:52:50 +0000 (13:52 -0600)
commit4e8ca6ee3a5d0e0f4c0cb32e43dc3d69e79e5a76
tree4efa5336730dc37f6895b5ac4357a8ee6338e1c9
parent860a445c25aa2f99aa5881603a1f4ed2cec64025
Revert "OF: base: match each node compatible against all given matches first"

This reverts commit 105353145eafb3ea919f5cdeb652a9d8f270228e.
Stephen Chivers reported this is broken as we will get a match
entry '.type = "serial"' instead of the '.compatible = "ns16550"'
in the following scenario:
serial0: serial@4500 {
compatible = "fsl,ns16550", "ns16550";
}

struct of_device_id of_platform_serial_table[] = {
{ .compatible = "ns8250",   .data = (void *)PORT_8250, },
{ .compatible = "ns16450",  .data = (void *)PORT_16450, },
{ .compatible = "ns16550a", .data = (void *)PORT_16550A, },
{ .compatible = "ns16550",  .data = (void *)PORT_16550, },
{ .compatible = "ns16750",  .data = (void *)PORT_16750, },
{ .compatible = "ns16850",  .data = (void *)PORT_16850, },
...
{ .type = "serial",         .data = (void *)PORT_UNKNOWN, },
{ /* end of list */ },
};

So just revert this patch, we will use another implementation to find
the best compatible match in a follow-on patch.

Reported-by: Stephen N Chivers <schivers@csc.com.au>
Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/base.c