aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/sys.c
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/sys.c
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/sys.c')
-rw-r--r--drivers/base/sys.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 9dff77bfe1e3..409f5ce78829 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -126,7 +126,7 @@ void sysdev_class_remove_file(struct sysdev_class *c,
126} 126}
127EXPORT_SYMBOL_GPL(sysdev_class_remove_file); 127EXPORT_SYMBOL_GPL(sysdev_class_remove_file);
128 128
129static struct kset *system_kset; 129extern struct kset *system_kset;
130 130
131int sysdev_class_register(struct sysdev_class *cls) 131int sysdev_class_register(struct sysdev_class *cls)
132{ 132{
@@ -331,14 +331,6 @@ void sysdev_unregister(struct sys_device *sysdev)
331EXPORT_SYMBOL_GPL(sysdev_register); 331EXPORT_SYMBOL_GPL(sysdev_register);
332EXPORT_SYMBOL_GPL(sysdev_unregister); 332EXPORT_SYMBOL_GPL(sysdev_unregister);
333 333
334int __init system_bus_init(void)
335{
336 system_kset = kset_create_and_add("system", NULL, &devices_kset->kobj);
337 if (!system_kset)
338 return -ENOMEM;
339 return 0;
340}
341
342#define to_ext_attr(x) container_of(x, struct sysdev_ext_attribute, attr) 334#define to_ext_attr(x) container_of(x, struct sysdev_ext_attribute, attr)
343 335
344ssize_t sysdev_store_ulong(struct sys_device *sysdev, 336ssize_t sysdev_store_ulong(struct sys_device *sysdev,