of_slim_get_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ of_slim_get_device β€” bestie's guide to grabbing a device from a dt node ✨

okay so this one's a kernel API page, it lives in the manual section 9 (the kernel API one, iykyk), and honestly? it's giving "small function, big responsibilities" πŸ’…


🌸 NAME 🌸

of_slim_get_device β€” get a handle to a device using a dt node.

like, that's the whole vibe. you've got a device tree node and you want the device. slay.


πŸŽ€ SYNOPSIS πŸŽ€

struct slim_device * of_slim_get_device (struct slim_controller *ctrl ,
struct device_node *np );

two args, one pointer back. classic. no cap.


πŸ¦‹ ARGUMENTS πŸ¦‹

  • ctrl β€” the controller on which this device will be queried. that's the Slimbus controller you're asking, bestie, like "hey do you know this one?"
  • np β€” node pointer to device. literally just the pointer to the device_node for the device you're curious about 🫢

πŸ’– DESCRIPTION πŸ’–

so here's the tea: it takes a reference to the embedded struct device, and that reference needs to be dropped after use. not optional. not a suggestion. drop it. πŸ”₯

bestie if you forget to drop that reference it's gonna sit there forever. don't be that person 😭

⭐ RETURN ⭐

pointer to a device if it has been registered, otherwise NULL.

that's it. either you get the pointer or you get NULL, and if you got NULL don't go dereferencing it, that's not a mood πŸ’€


🌈 SEE ALSO 🌈


that's the page, bestie. go forth and get your devices (responsibly, and drop that reference) πŸ‘‘

this one comes to you from ./drivers/slimbus, dated October 2026 β€” so fresh, so iconic, periodt πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from