of_graph_get_next_port(9)
π 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, orNULLto get the first one. passNULLwhen 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 π
- Kernel file
./drivers/of/property.c of_property_read_bool(9)of_graph_is_present(9)of_property_count_elems_of_size(9)of_find_property_value_of_size(9)of_property_read_u8_index(9)of_property_read_u16_index(9)of_property_read_u32_index(9)of_property_read_u64_index(9)of_property_read_variable_u8_array(9)of_property_read_variable_u16_array(9)of_property_read_variable_u32_array(9)of_property_read_u64(9)of_property_read_variable_u64_array(9)of_property_read_string(9)of_property_match_string(9)of_property_read_string_helper(9)of_graph_parse_endpoint(9)of_graph_get_port_by_id(9)of_graph_get_next_port_endpoint(9)of_graph_get_next_endpoint(9)of_graph_get_endpoint_by_regs(9)of_graph_get_remote_endpoint(9)of_graph_get_port_parent(9)of_graph_get_remote_port_parent(9)of_graph_get_remote_port(9)of_graph_get_endpoint_count(9)of_graph_get_port_count(9)of_graph_get_remote_node(9)parse_prop_cells(9)parse_suffix_prop_cells(9)struct supplier_bindings(9)of_link_property(9)
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
- 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