of_get_child_by_name(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

of_get_child_by_name β€” bestie, this is the one that finds the child node by name for a given parent ✨

So like, you got a parent node, you got a name, and this function is the matchmaker 🫢


🌸 SYNOPSIS 🌸

struct device_node * of_get_child_by_name (const struct device_node
*node , const char *name );

okay so the signature is a little long but she's iconic, we forgive her πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • node β€” the parent node πŸ’– the one doing the parenting, the main character of this whole operation
  • name β€” the child name to look for πŸ” like, the specific kid we're hunting for

πŸ¦‹ DESCRIPTION πŸ¦‹

This function looks for a child node for a given matching name 🌈

That's it, that's the vibe. You hand her a parent, you hand her a name, she goes looking for the child that matches. No cap, that is literally the entire job 😌


⭐ RETURN ⭐

You get a node pointer back if it's found πŸ‘‘ and β€” heads up bestie, this part matters β€” the refcount is incremented πŸ”₯ so you gotta call of_node_put on it when you're done with it. Like, clean up after yourself, be a good citizen πŸ’…

And if the node is not found? You get NULL back. Nothing. Empty. A whole mood πŸ’€ so please check for it, okay? πŸ™ˆ

Fr fr, don't forget the of_node_put. The refcount is not a suggestion, it's a commitment 🫢

🌸 SEE ALSO 🌸

Kernel file ./drivers/of/base.c β€” and here's the whole friend group, all of them, every single one πŸ’œ


and that's the page, bestie 🧚 go forth and find those child nodes πŸ’–

this lil gem lives over in ./drivers/of, dated October 2026, and it's of_get_child_by_name(9) from the Kernel API Manual β€” slay, periodt, bye πŸ’…πŸŽ€

πŸ“¦ where this page comes from