bus_register(9)
π bus_register(9) π
okay bestie, welcome to the kernel API manual, and today's main character is bus_register(9) β like, this is the kernel-doc page from the good people over in the kernel API manual department, and it's honestly giving "small function, huge responsibility." π¦
β¨ NAME β¨
bus_register β register a driver-core subsystem. that's it, that's the whole vibe check. π
β¨ SYNOPSIS β¨
int bus_register (const struct bus_type *bus );
lowkey the cleanest little signature ever, ngl. π
β¨ ARGUMENTS β¨
busβ the bus to register π this is the one (1) thing you're handing over, so make it count.
β¨ DESCRIPTION β¨
okay so picture this π«Ά once we have that, we register the bus with the kobject infrastructure, and then we register the children subsystems it has: the devices and drivers that belong to the subsystem. like, the whole fam gets introduced, not just the bus itself. so iconic of it. β¨
and yes, both of those are the children subsystems of your bus β the devices, and the drivers β and they're literally the whole point. the way the kernel just builds a little family tree and tells kobjects about every single member... obsessed. πΈ
β¨ SEE ALSO β¨
the kernel file ./drivers/base/bus.c is where all the lore lives, and here's the full squad of cross-references β no cap, all of them, not a single one skipped: π
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_unregister(9)subsys_dev_iter_init(9)subsys_dev_iter_next(9)subsys_dev_iter_exit(9)subsys_system_register(9)subsys_virtual_register(9)driver_find(9)bus_get_dev_root(9)
like a whole friend group of functions and every one of them is invited to the group chat. π₯
psa bestie: this page lives in ./drivers/base and it's dated October 2026 β so when you cite it, cite it with your whole chest. π§
okay that's the page!! stay slay, register those buses, and remember: kobject infrastructure first, children subsystems second. periodt. π ππ
π¦ 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