Name

of_device_is_compatible — check string matches device's compatible property

Synopsis

int of_device_is_compatible (const struct device_node * device,
 const char * compat);
 

Arguments

device

Pointer to node to be checked

compat

Required compatible string, NULL or "" for any match

Description

Checks if the given compat string matches one of the strings in the device's compatible property

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.

Return

0 for no match, and a positive integer on match. The return value is a relative score with larger values indicating better matches.