of_graph_get_next_port(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… of_graph_get_next_port(9) β€” from the Kernel API Manual, bestie

okay so this one is a little kernel function that walks through device-tree graph port nodes, like flipping through your fave accounts one at a time ✨ it lives in the Kernel API Manual, and if you're messing with of_graph stuff you're gonna want this in your back pocket, no cap.


🌸 SYNOPSIS 🌸

struct device_node * of_graph_get_next_port (const struct device_node
*parent , struct device_node *prev );

there she is. two args, one pointer back. slay.


πŸŽ€ ARGUMENTS πŸŽ€

  • parent β€” pointer to the parent device node, or the parent ports node. either one works, we love flexibility 🫢
  • prev β€” the previous port node, or NULL to get the first one. pass NULL when you're starting out, like a clean slate moment πŸ’œ

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: parent device node can be used as the parent whether the device node has a ports node or not. not optional, not conditional, it just handles both cases for you. it'll work the same as a ports0 node. periodt πŸ’…


✨ RETURN ✨

a 'port' node pointer with refcount incremented. and heads up β€” the refcount of the passed prev node is decremented. so like, the count moves with you as you walk the list, iykyk πŸ”₯

don't forget the refcount bookkeeping bestie, that's the whole point of this function 😭

πŸ‘‘ SEE ALSO πŸ‘‘

literally the whole of_graph friend group, go say hi 🌈


and that's the page!! πŸŽ€ this lil section of the manual ships out of ./drivers/of, dated October 2026, and yeah β€” it's of_graph_get_next_port(9), bestie, that's the whole title. go get those port nodes πŸ’–πŸ§šπŸ’€

πŸ“¦ where this page comes from