可以看到调用的device_driver->probe而不是platform_driver->probe
1 2 3 4 5 6 7 8 9 10 11
|
int (struct device_driver *drv, struct device *dev) { ret = really_probe(dev, drv); dev->driver = drv; if (dev->bus->probe) { ret = dev->bus->probe(dev); } else if (drv->probe) { ret = drv->probe(dev); } }
|
device_driver->probe也是platform_driver->probe
1 2 3 4 5 6 7 8 9
|
int platform_driver_register(struct platform_driver *drv) { drv->driver.bus = &platform_bus_type; if (drv->probe) drv->driver.probe = platform_drv_probe; return driver_register(&drv->driver); }
|
1 2 3 4 5 6 7
|
static int platform_drv_probe(struct device *_dev) { struct platform_driver *drv = to_platform_driver(_dev->driver); struct platform_device *dev = to_platform_device(_dev);
return drv->probe(dev); }
|
近期评论