summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2002-10-15 21:26:48 -0700
committerPatrick Mochel <mochel@osdl.org>2002-10-15 21:26:48 -0700
commit1067efac8c64c2608ececdca87e1329ba3ffa073 (patch)
tree12ceffb169635b5ab96fdc6c228837029f94f4db /include
parent2884fae053fb6a58f4f7c5985d574532b7ddd3d2 (diff)
driver model: change class reference counting to be like devices'.
device classes join the club of devices, buses, and drivers. They get a ->present flag, which is set on registration and cleared on unregistration. They also get get_devclass() and put_devclass(), which, you guessed it, bump the reference count. get_...() of course checks the present flag and returns NULL if clear.
Diffstat (limited to 'include')
-rw-r--r--include/linux/device.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 4b6b0cbe77ed..112fca2dd2d8 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -163,6 +163,9 @@ extern void driver_remove_file(struct device_driver *, struct driver_attribute *
*/
struct device_class {
char * name;
+ atomic_t refcount;
+ u32 present;
+
u32 devnum;
struct list_head node;
@@ -180,6 +183,9 @@ struct device_class {
extern int devclass_register(struct device_class *);
extern void devclass_unregister(struct device_class *);
+extern struct device_class * get_devclass(struct device_class *);
+extern void put_devclass(struct device_class *);
+
struct devclass_attribute {
struct attribute attr;