diff options
Diffstat (limited to 'include/linux/device.h')
| -rw-r--r-- | include/linux/device.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 4d8372d135df..246937c9cbc7 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -199,6 +199,11 @@ struct class { | |||
| 199 | struct class_private *p; | 199 | struct class_private *p; |
| 200 | }; | 200 | }; |
| 201 | 201 | ||
| 202 | struct class_dev_iter { | ||
| 203 | struct klist_iter ki; | ||
| 204 | const struct device_type *type; | ||
| 205 | }; | ||
| 206 | |||
| 202 | extern struct kobject *sysfs_dev_block_kobj; | 207 | extern struct kobject *sysfs_dev_block_kobj; |
| 203 | extern struct kobject *sysfs_dev_char_kobj; | 208 | extern struct kobject *sysfs_dev_char_kobj; |
| 204 | extern int __must_check __class_register(struct class *class, | 209 | extern int __must_check __class_register(struct class *class, |
| @@ -213,6 +218,13 @@ extern void class_unregister(struct class *class); | |||
| 213 | __class_register(class, &__key); \ | 218 | __class_register(class, &__key); \ |
| 214 | }) | 219 | }) |
| 215 | 220 | ||
| 221 | extern void class_dev_iter_init(struct class_dev_iter *iter, | ||
| 222 | struct class *class, | ||
| 223 | struct device *start, | ||
| 224 | const struct device_type *type); | ||
| 225 | extern struct device *class_dev_iter_next(struct class_dev_iter *iter); | ||
| 226 | extern void class_dev_iter_exit(struct class_dev_iter *iter); | ||
| 227 | |||
| 216 | extern int class_for_each_device(struct class *class, struct device *start, | 228 | extern int class_for_each_device(struct class *class, struct device *start, |
| 217 | void *data, | 229 | void *data, |
| 218 | int (*fn)(struct device *dev, void *data)); | 230 | int (*fn)(struct device *dev, void *data)); |
| @@ -396,7 +408,7 @@ struct device { | |||
| 396 | spinlock_t devres_lock; | 408 | spinlock_t devres_lock; |
| 397 | struct list_head devres_head; | 409 | struct list_head devres_head; |
| 398 | 410 | ||
| 399 | struct list_head node; | 411 | struct klist_node knode_class; |
| 400 | struct class *class; | 412 | struct class *class; |
| 401 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 413 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
| 402 | struct attribute_group **groups; /* optional groups */ | 414 | struct attribute_group **groups; /* optional groups */ |
