subsys_virtual_register(9)
πΈ NAME πΈ
okay so bestie, meet subsys_virtual_register(9) from the Kernel API Manual β it's literally the function that registers a subsystem at /sys/devices/virtual/. slay π
β¨ SYNOPSIS β¨
int subsys_virtual_register (const struct bus_type *subsys , const
struct attribute_group **groups );
π ARGUMENTS π
subsysβ the virtual subsystem. that's the main character right there πgroupsβ default attributes for the root device. the root device's lil starter pack π
π¦ DESCRIPTION π¦
okay so here's the vibe check: all 'virtual' subsystems have a /sys/devices/system/<name> root device with the name of the subsystem. the root device can carry subsystem-wide attributes. all registered devices are below this single root device. there's no restriction on device naming β literally none, name it whatever, no cap. this is for kernel software constructs which need sysfs interface. periodt. π
π SEE ALSO π
Kernel file ./drivers/base/bus.c β and the whole friend group is right here, bestie:
bus_to_subsys(9)bus_for_each_dev(9)bus_find_device(9)bus_for_each_drv(9)bus_add_device(9)bus_probe_device(9)bus_remove_device(9)bus_add_driver(9)bus_remove_driver(9)bus_rescan_devices(9)device_reprobe(9)bus_register(9)bus_unregister(9)subsys_dev_iter_init(9)subsys_dev_iter_next(9)subsys_dev_iter_exit(9)subsys_system_register(9)driver_find(9)bus_get_dev_root(9)
mwah π cute lil sign-off time: source/version is ./drivers/base, date is October 2026, and the page is subsys_virtual_register(9) β that's the whole footer energy, no cap π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms