of_get_next..._with_prefix(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« NAME πŸ’«

okay bestie, welcome to the of_get_next..._with_prefix(9) page in the Kernel API Manual ✨ the function in question is of_get_next_child_with_prefix β€” and its whole job is: Find the next child node with prefix. slay.


✨ SYNOPSIS ✨

struct device_node * of_get_next_child_with_prefix (const struct
device_node *node , struct device_node *prev , const char *prefix );

πŸŽ€ ARGUMENTS πŸŽ€

  • node β€” parent node. this is the parent node whose children we're browsing, main character energy πŸ‘‘
  • prev β€” previous child of the parent node, or NULL to get first. so you pass the last child you found to keep the walk going, or NULL to start from the beginning. iykyk πŸ¦‹
  • prefix β€” prefix that the node name should have. if a node's name doesn't have this prefix, it gets skipped, no cap πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

so of_get_next_child_with_prefix is literally like of_get_next_child, except that it automatically skips any nodes whose name doesn't have the given prefix. it's giving built-in filter energy 🌸 the way it just quietly ghosts the non-matching nodes? iconic. the only children you see are the ones whose names have that prefix, periodt πŸ’–


πŸ’– RETURN πŸ’–

A node pointer with refcount incremented β€” use of_node_put on it when done. and bestie, do not forget this one 😭 the refcount is incremented, so you have to release it with of_node_put when you're finished. like, that's the whole vibe check. 🫢


🌈 SEE ALSO 🌈

Kernel file: ./drivers/of/base.c

the whole friend group is right here:


xoxo, signed by ./drivers/of, dated October 2026, page of_get_next..._with_prefix(9) πŸ’…πŸŽ€

πŸ“¦ where this page comes from