• Kevin Hao's avatar
    Revert "OF: base: match each node compatible against all given matches first" · 4e8ca6ee
    Kevin Hao authored
    This reverts commit 10535314.
    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: default avatarStephen N Chivers <schivers@csc.com.au>
    Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
    Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
    Signed-off-by: default avatarRob Herring <robh@kernel.org>
    4e8ca6ee
base.c 51.5 KB