1
votes

In the pre-Device Tree model, the driver code would call platform_driver_register(), registering a driver with a certain name, and the architecture-specific code would call platform_add_device() which will create a platform_device and match it with a platform_driver of the same name, calling its probe function.

If Device Trees are used, my understanding is that the node's "compatible" property is matched with the "compatible" property of a platform_driver, and then the probe function is called. In this case, is it still necessary for the architecture-specific code to call platform_add_device(), or is the presence of a device tree node enough for the kernel to create a platform_device and call the platform_driver's probe() function with this device?

1

1 Answers

2
votes

I believe whe whole point of device tree is so your arch specific code doesnt have to call platform_add_device().

In other words, no you don't have to call platform_add_device() if you use device trees to match your devices to drivers.