* @brief Helper function for implementing DEVICE_PROBE() * * This function can be used to help implement the DEVICE_PROBE() for * a bus (i.e. a device which has other devices attached to it). It * calls the DEVICE_IDENTIFY() method of each driver in the device's * devclass. */
| 3679 | * devclass. |
| 3680 | */ |
| 3681 | int |
| 3682 | bus_generic_probe(device_t dev) |
| 3683 | { |
| 3684 | devclass_t dc = dev->devclass; |
| 3685 | driverlink_t dl; |
| 3686 | |
| 3687 | TAILQ_FOREACH(dl, &dc->drivers, link) { |
| 3688 | /* |
| 3689 | * If this driver's pass is too high, then ignore it. |
| 3690 | * For most drivers in the default pass, this will |
| 3691 | * never be true. For early-pass drivers they will |
| 3692 | * only call the identify routines of eligible drivers |
| 3693 | * when this routine is called. Drivers for later |
| 3694 | * passes should have their identify routines called |
| 3695 | * on early-pass buses during BUS_NEW_PASS(). |
| 3696 | */ |
| 3697 | if (dl->pass > bus_current_pass) |
| 3698 | continue; |
| 3699 | DEVICE_IDENTIFY(dl->driver, dev); |
| 3700 | } |
| 3701 | |
| 3702 | return (0); |
| 3703 | } |
| 3704 | |
| 3705 | /** |
| 3706 | * @brief Helper function for implementing DEVICE_ATTACH() |
no outgoing calls
no test coverage detected