of_slim_get_device(9)
β¨ 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 thedevice_nodefor 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 π
- Kernel file
./drivers/slimbus/core.c slim_unregister_controller(9)slim_report_absent(9)slim_get_device(9)slim_device_report_present(9)slim_get_logical_addr(9)
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
- 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