Platform drivers also work with DT. It is the recommended way to deal with platform devices nowadays, and there is no need to touch board files anymore, or even to recompile the kernel when a device's property changes. If you remember, in the previous chapter we discussed OF match style, which is a matching mechanism based on the DT. Let's see in the following section how it works.
Platform drivers and DT
OF match style
OF match style is the first matching mechanism performed by the platform core in order to match devices with their drivers. It uses the 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...