When does the probe function for a Linux kernel driver gets called?

João Pinto picture João Pinto · Feb 7, 2012 · Viewed 20.7k times · Source

I am trying to update a kernel driver for Android, I have added some printk's to debug it, the _init function is invoked, but the probe function is not. What I am missing ? When/how is the probe function invoked ?

The code is available at: https://github.com/lamegopinto/kernel-2.6.32.27-M722HC/blob/master/drivers/power/rk2918_battery.c

Answer

João Pinto picture João Pinto · Feb 7, 2012

Found the answer after some research, For a "platform" device the probe function is invoked when a platform device is registered and it's device name matchs the name specified on the device driver.

More details here: http://comments.gmane.org/gmane.linux.kernel.kernelnewbies/37050

Now I just need to figure why the device is not being registered :\