1BUS_FOR_EACH_DEV(9)      Device drivers infrastructure     BUS_FOR_EACH_DEV(9)
2
3
4

NAME

6       bus_for_each_dev - device iterator.
7

SYNOPSIS

9       int bus_for_each_dev(struct bus_type * bus, struct device * start,
10                            void * data, int (*fn) (struct device *, void *));
11

ARGUMENTS

13       bus
14           bus type.
15
16       start
17           device to start iterating from.
18
19       data
20           data for the callback.
21
22       fn
23           function to be called for each device.
24

DESCRIPTION

26       Iterate over bus´s list of devices, and call fn for each, passing it
27       data. If start is not NULL, we use that device to begin iterating from.
28
29       We check the return of fn each time. If it returns anything other than
30       0, we break out and return that value.
31

NOTE

33       The device that returns a non-zero value is not retained in any way,
34       nor is its refcount incremented. If the caller needs to retain this
35       data, it should do so, and increment the reference count in the
36       supplied callback.
37
39Kernel Hackers Manual 2.6.         June 2019               BUS_FOR_EACH_DEV(9)
Impressum