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 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.

Return

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