of_get_parent(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 of_get_parent β€” Kernel API Manual 🌸

okay so welcome to of_get_parent(9), bestie!! this is the Kernel API Manual entry for it and it's literally the "who's your mom" function of the device tree world πŸ’… we're talking drivers/of territory, iykyk.


✨ NAME ✨

of_get_parent β€” get a node's parent if any 🫢

like, if this node has a parent? you're getting it. if not? no parent, no vibes, that's just how it is.


πŸ¦‹ SYNOPSIS πŸ¦‹

struct device_node * of_get_parent (const struct device_node *node );

that's it. one function, one argument, returns a struct device_node *. main character energy fr fr ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • node β€” the node you want the parent of πŸ‘‘ (original wording: "Node to get parent")

πŸ’– RETURN πŸ’–

so you get back a node pointer, and the refcount is incremented β€” meaning you own a reference now, bestie, and you are responsible for it 😭 call of_node_put on it when you're done. no leaking refs in this house, periodt πŸ’…

ngl this is the part everyone forgets. don't be everyone. of_node_put it. 🫢

🌈 SEE ALSO 🌈

the kernel file is ./drivers/of/base.c and here's the whole squad of related functions β€” yes, all of them, I'm not skipping a single one 🧚:


and that's the whole page, bestie πŸ“πŸ’œ sourced from ./drivers/of, dated October 2026 β€” go forth, grab your parents, and remember to of_node_put πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from