diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-08 01:19:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-26 00:08:38 -0400 |
commit | c205ef4880273d2de4ee5388d4e52227ff688cc4 (patch) | |
tree | 78e7cde849b9c40fd323b5550a8e64d5d169c55f /include/linux/device.h | |
parent | a2de48cace5d0993da6cfa28b276ae724dc3569b (diff) |
Driver core: create devices/virtual/ tree
This change creates a devices/virtual/CLASS_NAME tree for struct devices
that belong to a class, yet do not have a "real" struct device for a
parent. It automatically creates the directories on the fly as needed.
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r-- | include/linux/device.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index 3400e09bf45..bbb0d6b5d23 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -149,6 +149,8 @@ struct class { | |||
149 | struct list_head interfaces; | 149 | struct list_head interfaces; |
150 | struct semaphore sem; /* locks both the children and interfaces lists */ | 150 | struct semaphore sem; /* locks both the children and interfaces lists */ |
151 | 151 | ||
152 | struct kobject *virtual_dir; | ||
153 | |||
152 | struct class_attribute * class_attrs; | 154 | struct class_attribute * class_attrs; |
153 | struct class_device_attribute * class_dev_attrs; | 155 | struct class_device_attribute * class_dev_attrs; |
154 | struct device_attribute * dev_attrs; | 156 | struct device_attribute * dev_attrs; |
@@ -291,7 +293,6 @@ extern struct class_device *class_device_create(struct class *cls, | |||
291 | __attribute__((format(printf,5,6))); | 293 | __attribute__((format(printf,5,6))); |
292 | extern void class_device_destroy(struct class *cls, dev_t devt); | 294 | extern void class_device_destroy(struct class *cls, dev_t devt); |
293 | 295 | ||
294 | |||
295 | /* interface for exporting device attributes */ | 296 | /* interface for exporting device attributes */ |
296 | struct device_attribute { | 297 | struct device_attribute { |
297 | struct attribute attr; | 298 | struct attribute attr; |
@@ -400,6 +401,8 @@ extern struct device *device_create(struct class *cls, struct device *parent, | |||
400 | __attribute__((format(printf,4,5))); | 401 | __attribute__((format(printf,4,5))); |
401 | extern void device_destroy(struct class *cls, dev_t devt); | 402 | extern void device_destroy(struct class *cls, dev_t devt); |
402 | 403 | ||
404 | extern int virtual_device_parent(struct device *dev); | ||
405 | |||
403 | /* | 406 | /* |
404 | * Platform "fixup" functions - allow the platform to have their say | 407 | * Platform "fixup" functions - allow the platform to have their say |
405 | * about devices and actions that the general device layer doesn't | 408 | * about devices and actions that the general device layer doesn't |