While going through the usb code in linux. I came across platform_device_add() api.
My question is when we create a platform device using the above api, how does the associated driver gets bind to it?
As per my understanding is that the platform drivers register itself and when a match occurs with the device tree compatible string and the one mentioned in the driver, the probe of the driver is called.
So does it use something like a "compatible string" as in the case of the device tree? Does it use the "name" field present in the "struct platform_device" and match it with the "struct platform_driver" 's "name" field.
Please correct me if I am wrong. Also any text source to learn more on this will be helpful as I am new to this.