参考:struct device_driver的probe的调用http://bbs.chinaunix.net/thread-2120664-1-1.html
弄了HBA驱动几个月了,现在把学习到的东西总结一下。
首先是关于HBA的probe过程。在kernel里面是怎么调用的,看下面:
module_init(pm8001_init)----->pm8001_init(void)----->pci_register_driver(&pm8001_pci_driver)-----> __pci_register_driver(struct pci_driver *drv, struct module *owner, const char *mod_name)----->driver_register(&drv->driver)----->
bus_add_driver(drv)----->driver_attach(drv)-----> __driver_attach(struct device *dev, void *data)----->driver_probe_device(drv, dev)----->
really_probe(dev, drv)----->dev->bus->probe(dev)(或者drv->probe(dev))。根据条件:if(dev->bus->probe),执行dev->bus->probe(dev),
由:
struct bus_type pci_bus_type = {
.name &