diff options
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r-- | drivers/base/base.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h index 2c9ae43e2219..0ec372a67762 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h | |||
@@ -36,6 +36,33 @@ struct driver_private { | |||
36 | }; | 36 | }; |
37 | #define to_driver(obj) container_of(obj, struct driver_private, kobj) | 37 | #define to_driver(obj) container_of(obj, struct driver_private, kobj) |
38 | 38 | ||
39 | |||
40 | /** | ||
41 | * struct class_private - structure to hold the private to the driver core portions of the class structure. | ||
42 | * | ||
43 | * @subsys - the struct kset that defines this class. This is the main kobject | ||
44 | * @children - list of class_devices associated with this class | ||
45 | * @devices - list of devices associated with this class | ||
46 | * @interfaces - list of class_interfaces associated with this class | ||
47 | * @class_dirs - | ||
48 | * @sem - semaphore to protect the children, devices, and interfaces lists. | ||
49 | * @class - pointer back to the struct class that this structure is associated | ||
50 | * with. | ||
51 | * | ||
52 | * This structure is the one that is the actual kobject allowing struct | ||
53 | * class to be statically allocated safely. Nothing outside of the driver | ||
54 | * core should ever touch these fields. | ||
55 | */ | ||
56 | struct class_private { | ||
57 | struct kset subsys; | ||
58 | struct list_head devices; | ||
59 | struct list_head interfaces; | ||
60 | struct kset class_dirs; | ||
61 | struct semaphore sem; | ||
62 | struct class *class; | ||
63 | }; | ||
64 | #define to_class(obj) container_of(obj, struct class_private, subsys.kobj) | ||
65 | |||
39 | /* initialisation functions */ | 66 | /* initialisation functions */ |
40 | extern int devices_init(void); | 67 | extern int devices_init(void); |
41 | extern int buses_init(void); | 68 | extern int buses_init(void); |