* Find a device of a given class. * * @param class Class of the device. * @param from Pointer to the device structure, used as a starting point in * the linked list of all_devices, which can be 0 to start at the * head of the list (i.e. all_devices). * @return Pointer to the device struct. */
| 65 | * @return Pointer to the device struct. |
| 66 | */ |
| 67 | struct device *dev_find_class(unsigned int class, struct device *from) |
| 68 | { |
| 69 | if (!from) |
| 70 | from = all_devices; |
| 71 | else |
| 72 | from = from->next; |
| 73 | |
| 74 | while (from && (from->class & 0xffffff00) != class) |
| 75 | from = from->next; |
| 76 | |
| 77 | return from; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Encode the device path into 3 bytes for logging to CMOS. |
no outgoing calls
no test coverage detected