of_device_is_compatible — check string matches device's “compatible” property
int of_device_is_compatible ( | const struct device_node * device, |
const char * compat) ; |
device
Pointer to node to be checked
compat
Required compatible string, NULL or "" for any match
Checks if the given compat
string matches one of the strings in
thr “compatible” property found in device
.
The return score is weighted for the most specific compatible value to get the highest score. This assumes that the ordering of strings in the “compatible” is from the most specific to the least specific, as specified in the bindings standards.
Note that the score is the opposite of of_fdt_is_compatible
and
of_fdt_match
, which report smaller scores as more compatible.