aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/base.h
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-12-14 17:29:38 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-14 17:29:38 -0500
commitca22e56debc57b47c422b749c93217ba62644be2 (patch)
treebb2da058ddc05f8cde1161a60f7fdce9620c63ff /drivers/base/base.h
parent6261ddee70174372d6a75601f40719b7a5392f3f (diff)
driver-core: implement 'sysdev' functionality for regular devices and buses
All sysdev classes and sysdev devices will converted to regular devices and buses to properly hook userspace into the event processing. There is no interesting difference between a 'sysdev' and 'device' which would justify to roll an entire own subsystem with different userspace export semantics. Userspace relies on events and generic sysfs subsystem infrastructure from sysdev devices, which are currently not properly available. Every converted sysdev class will create a regular device with the class name in /sys/devices/system and all registered devices will becom a children of theses devices. For compatibility reasons, the sysdev class-wide attributes are created at this parent device. (Do not copy that logic for anything new, subsystem- wide properties belong to the subsystem, not to some fake parent device created in /sys/devices.) Every sysdev driver is implemented as a simple subsystem interface now, and no longer called a driver. After all sysdev classes are ported to regular driver core entities, the sysdev implementation will be entirely removed from the kernel. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r--drivers/base/base.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 21c1b96c34c..7a6ae422876 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -4,7 +4,9 @@
4 * struct subsys_private - structure to hold the private to the driver core portions of the bus_type/class structure. 4 * struct subsys_private - structure to hold the private to the driver core portions of the bus_type/class structure.
5 * 5 *
6 * @subsys - the struct kset that defines this subsystem 6 * @subsys - the struct kset that defines this subsystem
7 * @devices_kset - the list of devices associated 7 * @devices_kset - the subsystem's 'devices' directory
8 * @interfaces - list of subsystem interfaces associated
9 * @mutex - protect the devices, and interfaces lists.
8 * 10 *
9 * @drivers_kset - the list of drivers associated 11 * @drivers_kset - the list of drivers associated
10 * @klist_devices - the klist to iterate over the @devices_kset 12 * @klist_devices - the klist to iterate over the @devices_kset
@@ -14,10 +16,8 @@
14 * @bus - pointer back to the struct bus_type that this structure is associated 16 * @bus - pointer back to the struct bus_type that this structure is associated
15 * with. 17 * with.
16 * 18 *
17 * @class_interfaces - list of class_interfaces associated
18 * @glue_dirs - "glue" directory to put in-between the parent device to 19 * @glue_dirs - "glue" directory to put in-between the parent device to
19 * avoid namespace conflicts 20 * avoid namespace conflicts
20 * @class_mutex - mutex to protect the children, devices, and interfaces lists.
21 * @class - pointer back to the struct class that this structure is associated 21 * @class - pointer back to the struct class that this structure is associated
22 * with. 22 * with.
23 * 23 *
@@ -28,6 +28,8 @@
28struct subsys_private { 28struct subsys_private {
29 struct kset subsys; 29 struct kset subsys;
30 struct kset *devices_kset; 30 struct kset *devices_kset;
31 struct list_head interfaces;
32 struct mutex mutex;
31 33
32 struct kset *drivers_kset; 34 struct kset *drivers_kset;
33 struct klist klist_devices; 35 struct klist klist_devices;
@@ -36,9 +38,7 @@ struct subsys_private {
36 unsigned int drivers_autoprobe:1; 38 unsigned int drivers_autoprobe:1;
37 struct bus_type *bus; 39 struct bus_type *bus;
38 40
39 struct list_head class_interfaces;
40 struct kset glue_dirs; 41 struct kset glue_dirs;
41 struct mutex class_mutex;
42 struct class *class; 42 struct class *class;
43}; 43};
44#define to_subsys_private(obj) container_of(obj, struct subsys_private, subsys.kobj) 44#define to_subsys_private(obj) container_of(obj, struct subsys_private, subsys.kobj)
@@ -94,7 +94,6 @@ extern int hypervisor_init(void);
94static inline int hypervisor_init(void) { return 0; } 94static inline int hypervisor_init(void) { return 0; }
95#endif 95#endif
96extern int platform_bus_init(void); 96extern int platform_bus_init(void);
97extern int system_bus_init(void);
98extern int cpu_dev_init(void); 97extern int cpu_dev_init(void);
99 98
100extern int bus_add_device(struct device *dev); 99extern int bus_add_device(struct device *dev);
@@ -116,6 +115,7 @@ extern char *make_class_name(const char *name, struct kobject *kobj);
116 115
117extern int devres_release_all(struct device *dev); 116extern int devres_release_all(struct device *dev);
118 117
118/* /sys/devices directory */
119extern struct kset *devices_kset; 119extern struct kset *devices_kset;
120 120
121#if defined(CONFIG_MODULES) && defined(CONFIG_SYSFS) 121#if defined(CONFIG_MODULES) && defined(CONFIG_SYSFS)