platform_driver_register

时间:2026-01-12 23:38:09编辑:莆田seo君

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的时候了。


上一篇:论文中期检查ppt

下一篇:没有了