1CLASS_FIND_DEVICE(9) Device drivers infrastructure CLASS_FIND_DEVICE(9)
2
3
4
6 class_find_device - device iterator for locating a particular device
7
9 struct device * class_find_device(struct class * class,
10 struct device * start,
11 const void * data,
12 int (*match) (struct device *, const void *));
13
15 class
16 the class we're iterating
17
18 start
19 Device to begin with
20
21 data
22 data for the match function
23
24 match
25 function to check device
26
28 This is similar to the class_for_each_dev function above, but it
29 returns a reference to a device that is 'found' for later use, as
30 determined by the match callback.
31
32 The callback should return 0 if the device doesn't match and non-zero
33 if it does. If the callback returns non-zero, this function will return
34 to the caller and not iterate over any more devices.
35
36 Note, you will need to drop the reference with put_device after use.
37
38 fn is allowed to do anything including calling back into class code.
39 There's no locking restriction.
40
42Kernel Hackers Manual 3.10 June 2019 CLASS_FIND_DEVICE(9)