Linux驱动中,probe函数何时被调用
在驱动程序注册的时候,会有一个match的过程,将驱动和设备两个匹配。在匹配的过程中会调用probe函数。
在bus.c中会出现static int bus_match(struct device * dev, struct device_driver * drv),这个函数就会调用
if (drv->probe) {
if ((error = drv->probe(dev))) {
dev->driver = NULL;
return error;
},这个时候就是调用Probe的时候了。
你可以看下这个连接
http://www.cnblogs.com/hoys/archive/2011/04/01/2002299.html
Linux驱动中probe函数何时被调用
在驱动程序注册的时候,会有一个match的过程,将驱动和设备两个匹配。在匹配的过程中会调用probe函数。
在bus.c中会出现static int bus_match(struct device * dev, struct device_driver * drv),这个函数就会调用,参看下面的代码:
if (drv->probe) {
if ((error = drv->probe(dev))) {
dev->driver = NULL;
return error;
}
执行到此时,就是调用Probe的时候了。

