On Tue, Feb 18, 2014 at 10:29:18PM +0000, Grant Likely wrote: > On Tue, 18 Feb 2014 15:57:30 +0800, Kevin Hao <haokexin@xxxxxxxxx> wrote: > > In the current implementation of __of_match_node(), it will compare > > each given match entry against all the node's compatible strings > > with of_device_is_compatible(). > > > > To achieve multiple compatible strings per node with ordering from > > specific to generic, this requires given matches to be ordered from > > specific to generic. For most of the drivers this is not true and > > also an alphabetical ordering is more sane there. > > > > Therefore, we define a following priority order for the match, and > > then scan all the entries to find the best match. > > 1. specific compatible && type && name > > 2. specific compatible && type > > 3. specific compatible && name > > 4. specific compatible > > 5. general compatible && type && name > > 6. general compatible && type > > 7. general compatible && name > > 8. general compatible > > 9. type && name > > 10. type > > 11. name > > > > This is based on some pseudo-codes provided by Grant Likely. > > The patch looks good, but I wasn't confident applying it directly > without some validation, so I've written a test case for this function. > I'll resend the series to the list and cc you. Unfortunately I've found > one case that is failing on the test cases, but I'm too tired to debug > it now. Maybe you'd like to take a look. The test case may very well be > wrong. The test case looks great. Actually there is a bug in this patch. I will make new spin to fix it. Thanks, Kevin
Attachment:
pgp94X5fyUwMF.pgp
Description: PGP signature