spmi_find_device_by_of_node(9)
π spmi_find_device_by_of_node β the kernel API manual, but make it make sense
okay so bestie, welcome to the spmi_find_device_by_of_node(9) page π«Ά this is kernel API manual territory, and honestly? it's a short one. we love a low-effort icon. β¨
πΈ NAME πΈ
spmi_find_device_by_of_node β literally just "look up an SPMI device from a device node". that's the whole vibe check. π
π SYNOPSIS π
struct spmi_device * spmi_find_device_by_of_node (struct device_node *np
);
yes the line break is really just like that in the original. we don't fix it. we respect it. π
π¦ ARGUMENTS π¦
npβ the device node. that's it, that's the argument. astruct device_node *and nothing else. she's low maintenance, we stan. π
β¨ DESCRIPTION β¨
okay so here's the tea, and this part is important, so pay attention bestie:
it takes a reference to the embedded struct device which needs to be dropped after use.
no cap. you grab it, you gotta let it go. holding onto that reference forever is giving red flag energy and the kernel will absolutely notice. π
and what do you get back? it returns the struct spmi_device associated with a device node β or NULL. that's the whole deal. either you get your device or you get nothing, and honestly? relatable. π
π SEE ALSO π
the kernel file ./drivers/spmi/spmi.c is where all the friends live, and here's the full group chat, no one left on read:
spmi_device_add(9)spmi_device_remove(9)spmi_register_read(9)spmi_ext_register_read(9)spmi_ext_register_readl(9)spmi_register_write(9)spmi_register_zero_write(9)spmi_ext_register_write(9)spmi_ext_register_writel(9)spmi_command_reset(9)spmi_command_sleep(9)spmi_command_wakeup(9)spmi_command_shutdown(9)spmi_device_alloc(9)spmi_controller_alloc(9)spmi_controller_add(9)spmi_controller_remove(9)__spmi_driver_register(9)
like, seventeen whole friends. she's connected. π
π the sign-off π
this whole thing lives in ./drivers/spmi (that's the source, mwah), it's dated October 2026, and the version is, you guessed it, spmi_find_device_by_of_node(9). go forth, look up your devices, and drop that reference β i'm serious, bestie. ππ§π
π¦ 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