1BUS_FOR_EACH_DRV(9) Device drivers infrastructure BUS_FOR_EACH_DRV(9)
2
3
4
6 bus_for_each_drv - driver iterator
7
9 int bus_for_each_drv(struct bus_type * bus,
10 struct device_driver * start, void * data,
11 int (*fn) (struct device_driver *, void *));
12
14 bus
15 bus we´re dealing with.
16
17 start
18 driver to start iterating on.
19
20 data
21 data to pass to the callback.
22
23 fn
24 function to call for each driver.
25
27 This is nearly identical to the device iterator above. We iterate over
28 each driver that belongs to bus, and call fn for each. If fn returns
29 anything but 0, we break out and return it. If start is not NULL, we
30 use it as the head of the list.
31
33 we don´t return the driver that returns a non-zero value, nor do we
34 leave the reference count incremented for that driver. If the caller
35 needs to know that info, it must set it in the callback. It must also
36 be sure to increment the refcount so it doesn´t disappear before
37 returning to the caller.
38
40Kernel Hackers Manual 2.6. June 2019 BUS_FOR_EACH_DRV(9)