• Tejun Heo's avatar
    driver/base: implement subsys_virtual_register() · d73ce004
    Tejun Heo authored
    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: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Kay Sievers <kay.sievers@vrfy.org>
base.h 4.82 KB