diff options
author | Tejun Heo <tj@kernel.org> | 2013-03-12 14:30:05 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-03-12 14:36:35 -0400 |
commit | d73ce004225a7b2ed75f4340bb63721d55552265 (patch) | |
tree | fa4b2ab4f064412018589307b988567a713b6d96 /drivers/base/base.h | |
parent | 6dbe51c251a327e012439c4772097a13df43c5b8 (diff) |
driver/base: implement subsys_virtual_register()
Kay tells me the most appropriate place to expose workqueues to
userland would be /sys/devices/virtual/workqueues/WQ_NAME which is
symlinked to /sys/bus/workqueue/devices/WQ_NAME and that we're lacking
a way to do that outside of driver core as virtual_device_parent()
isn't exported and there's no inteface to conveniently create a
virtual subsystem.
This patch implements subsys_virtual_register() by factoring out
subsys_register() from subsys_system_register() and using it with
virtual_device_parent() as the origin directory. It's identical to
subsys_system_register() other than the origin directory but we aren't
gonna restrict the device names which should be used under it.
This will be used to expose workqueue attributes to userland.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Diffstat (limited to 'drivers/base/base.h')
-rw-r--r-- | drivers/base/base.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h index 6ee17bb391a9..b8bdfe61daa6 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h | |||
@@ -101,6 +101,8 @@ static inline int hypervisor_init(void) { return 0; } | |||
101 | extern int platform_bus_init(void); | 101 | extern int platform_bus_init(void); |
102 | extern void cpu_dev_init(void); | 102 | extern void cpu_dev_init(void); |
103 | 103 | ||
104 | struct kobject *virtual_device_parent(struct device *dev); | ||
105 | |||
104 | extern int bus_add_device(struct device *dev); | 106 | extern int bus_add_device(struct device *dev); |
105 | extern void bus_probe_device(struct device *dev); | 107 | extern void bus_probe_device(struct device *dev); |
106 | extern void bus_remove_device(struct device *dev); | 108 | extern void bus_remove_device(struct device *dev); |