bus_get_dev_root(9)
π
bus_get_dev_root(9) π
okay so bestie, this page is from the Kernel API Manual, and it's literally about grabbing the βdevice rootβ pointer for a bus. yes maβam, thatβs the whole assignment. β¨
πΈ NAME πΈ
bus_get_dev_root β return a pointer to the βdevice rootβ of a bus. slay. π
π SYNOPSIS π
struct device * bus_get_dev_root (const struct bus_type *bus );
π¦ ARGUMENTS π¦
busβ the bus you want the device root of, bestie. thatβs it. thatβs the argument. π
β¨ DESCRIPTION β¨
okay so if a bus has a βdevice rootβ structure, this returns it β WITH THE REFERENCE COUNT INCREMENTED. yes, all caps, because this part is important, no cap. π₯
β οΈ note, when youβre finished with the device, a call to put_device is required. do not forget this, bestie. the reference is not gonna clean itself up. π
if the device root is not present β or if bus is not a valid pointer β NULL will be returned. thatβs the vibe check failing, and you get NULL. π
π SEE ALSO π
the Kernel file ./drivers/base/bus.c is the spot, and these are the related pages, all listed exactly because we keep every single one, periodt:
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)subsys_virtual_register(9)driver_find(9)
okay thatβs the whole page, bestie π«Ά β this oneβs from ./drivers/base, dated October 2026. now go forth and remember put_device(), or else. π
ππ
π¦ 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