class_for_each_device — device iterator
int class_for_each_device
(struct class * class, void * data, int (*fn)
(struct device *, void *));
the class we're iterating
data for the callback
function to be called for each device
Iterate over class's list of devices, and call fn for each, passing it data.
We check the return of fn each time. If it returns anything other than 0, we break out and return that value.
Note, we hold class->sem in this function, so it can not be re-acquired in fn, otherwise it will self-deadlocking. For example, calls to add or remove class members would be verboten.