from WHERE platform driver's probe is called?

subin gangadharan subingangadharan at gmail.com
Fri Nov 21 22:26:51 EST 2014


Hi Sunil,

>>I am still not able to locate from WHERE this probe function is called and WHO calls it?

I can try to give you a snapshot of the function call trace. But if
you really want to get in depth detail, as Greg said look at the code
driver/base.

driver_register
->bus_add_driver->driver_attach->__driver_attach->driver_probe_device->really_probe->drv->probe

Basically when you register your platform driver, the platform
bus(platform_bus_type) will scan for the matching device. If you look
at the platform_bus_type structure you can find the match function
which does the matching of driver and device. Once it's found the
right device, it will attach the driver to the device.Look at the
function driver_attach. And if you look at the
platform_driver_register function, you can see that
"platform_drv_probe" function is assigned to driver.probe function.
And this probe function will finally call your registered platform
driver probe function.

Hope this helps.



More information about the Kernelnewbies mailing list