October 2017
Intermediate to advanced
586 pages
14h 8m
English
OF match style is the first matching mechanism performed by the platform core in order to match devices with their drivers. It uses a device tree's compatible property to match the device entry in of_match_table, which is a field of the struct driver substructure. Each device node has a compatible property, which is a string or a list of strings. Any platform driver that declares one of the strings listed in the compatible property will trigger a match and will see its probe function executed.
A DT match entry is described in the kernel as an instance of the struct of_device_id structure, which is defined in linux/mod_devicetable.h and looks as follows:
// we are only interested in the two last elements of the structure struct ...
Read now
Unlock full access