diff options
author | gregkh@suse.de <gregkh@suse.de> | 2005-03-15 14:54:21 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:04 -0400 |
commit | e9ba6365fd4f0d9e7d022c883bd044fbaa48257f (patch) | |
tree | 062476167b5c9cd5ed08a01f223e71c2ece795ee /include | |
parent | 70f2817a43c89b784dc2ec3d06ba5bf3064f8235 (diff) |
[PATCH] CLASS: move a "simple" class logic into the class core.
One step on improving the class api so that it can not be used incorrectly.
This also fixes the module owner issue with the dev files that happened when
the devt logic moved to the class core.
Based on a patch originally written by Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/device.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h index fa9e6ca08f5a..73250d01c01f 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -143,6 +143,7 @@ extern void driver_remove_file(struct device_driver *, struct driver_attribute * | |||
143 | */ | 143 | */ |
144 | struct class { | 144 | struct class { |
145 | const char * name; | 145 | const char * name; |
146 | struct module * owner; | ||
146 | 147 | ||
147 | struct subsystem subsys; | 148 | struct subsystem subsys; |
148 | struct list_head children; | 149 | struct list_head children; |
@@ -185,6 +186,7 @@ struct class_device { | |||
185 | struct kobject kobj; | 186 | struct kobject kobj; |
186 | struct class * class; /* required */ | 187 | struct class * class; /* required */ |
187 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 188 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
189 | struct class_device_attribute *devt_attr; | ||
188 | struct device * dev; /* not necessary, but nice to have */ | 190 | struct device * dev; /* not necessary, but nice to have */ |
189 | void * class_data; /* class-specific data */ | 191 | void * class_data; /* class-specific data */ |
190 | 192 | ||
@@ -245,6 +247,13 @@ struct class_interface { | |||
245 | extern int class_interface_register(struct class_interface *); | 247 | extern int class_interface_register(struct class_interface *); |
246 | extern void class_interface_unregister(struct class_interface *); | 248 | extern void class_interface_unregister(struct class_interface *); |
247 | 249 | ||
250 | extern struct class *class_create(struct module *owner, char *name); | ||
251 | extern void class_destroy(struct class *cls); | ||
252 | extern struct class_device *class_device_create(struct class *cls, dev_t devt, | ||
253 | struct device *device, char *fmt, ...) | ||
254 | __attribute__((format(printf,4,5))); | ||
255 | extern void class_device_destroy(struct class *cls, dev_t devt); | ||
256 | |||
248 | /* interface for class simple stuff */ | 257 | /* interface for class simple stuff */ |
249 | extern struct class_simple *class_simple_create(struct module *owner, char *name); | 258 | extern struct class_simple *class_simple_create(struct module *owner, char *name); |
250 | extern void class_simple_destroy(struct class_simple *cs); | 259 | extern void class_simple_destroy(struct class_simple *cs); |