aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/base.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2008-08-25 13:50:19 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:04 -0400
commit5a3ceb861663040f9ef0176df4aaa494bba5e352 (patch)
tree035472164252c3b54071f044c161b312b6bc8b44 /drivers/base/base.h
parenta1ed5b0cffe4b16a93a6a3390e8cee0fbef94f86 (diff)
driver-core: use klist for class device list and implement iterator
Iterating over entries using callback usually isn't too fun especially when the entry being iterated over can't be manipulated freely. This patch converts class->p->class_devices to klist and implements class device iterator so that the users can freely build their own control structure. The users are also free to call back into class code without worrying about locking. class_for_each_device() and class_find_device() are converted to use the new iterators, so their users don't have to worry about locking anymore either. Note: This depends on klist-dont-iterate-over-deleted-entries patch because class_intf->add/remove_dev() depends on proper synchronization with device removal. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r--drivers/base/base.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 31dc0cd84afa..0a5f055dffba 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -54,7 +54,7 @@ struct driver_private {
54 */ 54 */
55struct class_private { 55struct class_private {
56 struct kset class_subsys; 56 struct kset class_subsys;
57 struct list_head class_devices; 57 struct klist class_devices;
58 struct list_head class_interfaces; 58 struct list_head class_interfaces;
59 struct kset class_dirs; 59 struct kset class_dirs;
60 struct mutex class_mutex; 60 struct mutex class_mutex;