for_each_of_graph_port(9)
π NAME π
okay so bestie, this is the manual page for for_each_of_graph_port(9) β straight from the Kernel API Manual β and it's here to help you iterate over every port in a device or ports node. periodt. β¨
π¦ SYNOPSIS π¦
for_each_of_graph_port (parent , child );
π ARGUMENTS π
parentβ the parent device or ports node containing the port. it's giving "where the ports live" energy π«Άchildβ the loop variable pointing to the current port node. main character of every loop pass, honestly π
π₯ DESCRIPTION π₯
So here's the tea β: when you break out of the loop, and you're still gonna keep using child, you need to use return_ptr(child) or no_free_ptr(child) so that __free is not called for it. no cap, this is the important bit β don't let the cleanup vibe free something you still need, bestie ππ
when you break out and keep usingchild, usereturn_ptr(child)orno_free_ptr(child)so you don't call__freefor it. π¨
π SEE ALSO π
- Kernel file
./include/linux/of_graph.h struct of_endpoint(9)for_each_endpoint_of_node(9)for_each_of_graph_port_endpoint(9)
mwah π β this iconic little page comes from source/version ./include/linux, dated October 2026, and it's literally the for_each_of_graph_port(9) manual. bye bestie, go slay those ports πβ¨π¦
π¦ 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