bus_get_dev_root(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:


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