Skip to content
Commit 06b29e76 authored by Kevin Hao's avatar Kevin Hao Committed by Rob Herring
Browse files

of: search the best compatible match first in __of_match_node()



Currently, of_match_node compares each given match against all 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, this patch introduces a function to match each of the node's
compatible strings against all given compatible matches without type and
name first, before checking the next compatible string. This implies
that node's compatibles are ordered from specific to generic while
given matches can be in any order. If we fail to find such a match
entry, then fall-back to the old method in order to keep compatibility.

Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
Tested-by: default avatarStephen Chivers <schivers@csc.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 4e8ca6ee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment