of_find_ser...ller_by_node(9)
π of_find_ser...ller_by_node(9) β a Kernel API Manual moment π
okay so bestie, welcome to the Kernel API Manual β¨ and yes the title really is truncated like that, it's giving "my name got cut off in the group chat preview" energy, but we move π
this is the page for of_find_ser...ller_by_node(9) fr fr.
πΈ NAME πΈ
of_find_serdev_controller_by_node β finds the serdev controller that's associated with the devicetree node, no cap π
π¦ SYNOPSIS π¦
struct serdev_controller * of_find_serdev_controller_by_node (struct device_node *node );
like, that's the whole vibe. it takes a node, it gives you a controller pointer. iconic behavior honestly π
π ARGUMENTS π
nodeβ the devicetree node you're looking with π« like this is the thing you hand over so the function knows which node you mean. just the devicetree node. that's it. that's the argument π«Ά
π₯ RETURN π₯
you get back a pointer to the serdev controller that's associated with the node π and if the controller isn't found? you get NULL. nothing. empty. the void. π not found energy.
IMPORTANT bestie, do NOT skip this part: the caller is responsible for calling serdev_controller_put to drop the reference. like, that reference is yours now, you own it, you gotta put it back when you're done. don't just wander off with it, that's not the move π
π SEE ALSO π
Kernel file ./drivers/tty/serdev/core.c β go read it, it's where the magic lives π§β¨
and then the whole little friend group of related functions, all appearing here so you know they exist:
serdev_device_add(9)serdev_device_remove(9)serdev_device_write_buf(9)serdev_device_write(9)serdev_device_alloc(9)serdev_controller_alloc(9)serdev_acpi_get_uart_resource(9)serdev_controller_add(9)serdev_controller_remove(9)__serdev_device_driver_register(9)
like a whole friend group of serdev functions, all linked up. iykyk π¦π«
vibe check recap: pass the node, get the controller,NULLif it's not there, and always always alwaysserdev_controller_putwhen you're done. main character responsibility energy ππ
and that's the page!! π this lil beauty lives in the ./drivers/tty/serdev section of the kernel docs and it's dated October 2026 β go off, kernel bestie, you're gonna do amazing with your serdev controllers πβ¨π«Ά
π¦ 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