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

NAME

6       class_for_each_device - device iterator
7

SYNOPSIS

9       int class_for_each_device(struct class * class, struct device * start,
10                                 void * data,
11                                 int (*fn) (struct device *, void *));
12

ARGUMENTS

14       class
15           the class we're iterating
16
17       start
18           the device to start with in the list, if any.
19
20       data
21           data for the callback
22
23       fn
24           function to be called for each device
25

DESCRIPTION

27       Iterate over class's list of devices, and call fn for each, passing it
28       data. If start is set, the list iteration will start there, otherwise
29       if it is NULL, the iteration starts at the beginning of the list.
30
31       We check the return of fn each time. If it returns anything other than
32       0, we break out and return that value.
33
34       fn is allowed to do anything including calling back into class code.
35       There's no locking restriction.
36
38Kernel Hackers Manual 3.10         June 2019           CLASS_FOR_EACH_DEVIC(9)
Impressum