summaryrefslogtreecommitdiff
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2003-01-05 11:31:14 -0600
committerPatrick Mochel <mochel@osdl.org>2003-01-05 11:31:14 -0600
commit3e815107666d4ee5089661a7125af302797b3e08 (patch)
tree14feb5b3f7d430ab82aec3fd98aeffff1d0aab15 /include/linux/device.h
parent2e1c40373d7e424a20b44858246ad3ef2ddc4a36 (diff)
Introduce struct kset.
struct kset is what struct subsystem should have originally been called. It is a set of kobjects, and nothing more, with a much less confusing name than 'subsystem.' struct kset contains an embedded kobject, making it possible to represent it in the object hierarchy, and sysfs. This also provides a means for objects to easily express a list of subordinate objects. struct subsystem still exists, and contains an rwsem, which its subordinate ksets use to protect their lists. An arbitrary number of ksets may belong to a subsystem. A ksets specifies the subsystem it belongs to via its ->subsys field. struct subsystem also contains a default kset, which may be used without having to define a separate kset. The objects that defined subordinate subsystems (bus and class drivers) have been converted to use subordinate ksets instead. Note that the usage of ksets is flexible. - ksets may contain a list of objects of any type, not just kobjects. - The objects registered with a kset do not have to be registered. - ksets themselves do not have to be registered. One can be used by simply calling kset_init(). - ksets do not need a name if they are not registered. - Note however that locking must be done manually in these cases.
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index 2a67cef3ae9f..ed58edf544f0 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -66,8 +66,8 @@ struct bus_type {
char * name;
struct subsystem subsys;
- struct subsystem drivers;
- struct subsystem devices;
+ struct kset drivers;
+ struct kset devices;
int (*match)(struct device * dev, struct device_driver * drv);
struct device * (*add) (struct device * parent, char * bus_id);
@@ -162,8 +162,8 @@ struct device_class {
u32 devnum;
struct subsystem subsys;
- struct subsystem devices;
- struct subsystem drivers;
+ struct kset devices;
+ struct kset drivers;
int (*add_device)(struct device *);
void (*remove_device)(struct device *);