fwnode_get_next_child_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ fwnode_get_next_child_node ✨

okay bestie, gather round, because this lil kernel API manual page (fwnode_get_next_child_node, from the Kernel API Manual, no cap) is literally about walking down the family tree of firmware nodes and finding the next child. it's giving "one node at a time, main character energy" πŸ¦‹

🌸 NAME 🌸

fwnode_get_next_child_node β€” return the next child node handle for a node πŸ‘‘

πŸŽ€ SYNOPSIS πŸŽ€

struct fwnode_handle * fwnode_get_next_child_node (const struct fwnode_handle *fwnode , struct fwnode_handle *child );

like, that's the whole signature, hun. fwnode is const, child isn't, and you get a struct fwnode_handle * back. slay πŸ’…

πŸ’– ARGUMENTS πŸ’–

  • fwnode β€” the firmware node you're like… finding the next child node for. your starting point, your home base, the parent in question 🫢
  • child β€” a handle to one of the node's child nodes, or a NULL handle. yes, NULL is literally allowed here, it's fine, breathe 😌

πŸ”₯ DESCRIPTION πŸ”₯

so here's the tea, and it's a big one, so listen up: the caller is responsible for calling fwnode_handle_put on the returned fwnode pointer. that ref is yours now. you own it. handle it. put it back when you're done or it's a leak and we don't do leaks in this house πŸ’€

and that's not even all of it β€” this function also puts a reference to child unconditionally. like, no vibe check, no "are you sure", it just does it. every time. periodt. so don't be out here holding onto child afterwards assuming you still got a ref, because bestie… you do not πŸ™ˆ

⚠️ fr fr, both of those ref-counting details are the whole ballgame. fwnode_handle_put on the returned pointer = your job. the unconditional put on child = already happened by the time you get control back. iykyk.

🌈 SEE ALSO 🌈

the kernel file lives at ./drivers/base/property.c and honestly the whole friend group is here, so let's do the roll call 🎀⭐

device_property_present(9), fwnode_property_present(9), device_property_read_bool(9), fwnode_property_read_bool(9), device_property_read_u8_array(9), device_property_read_u16_array(9), device_property_read_u32_array(9), device_property_read_u64_array(9), device_property_read_string_array(9), device_property_read_string(9), device_property_match_string(9), fwnode_property_read_u8_array(9), fwnode_property_read_u16_array(9), fwnode_property_read_u32_array(9), fwnode_property_read_u64_array(9), fwnode_property_read_string_array(9), fwnode_property_read_string(9), fwnode_property_match_string(9), fwnode_property_match_property_string(9), fwnode_property_get_reference_args(9), fwnode_find_reference(9), fwnode_get_name(9), fwnode_get_name_prefix(9), fwnode_name_eq(9), fwnode_get_parent(9), fwnode_get_next_parent(9), fwnode_count_parents(9), fwnode_get_nth_parent(9), fwnode_get_next_available_child_node(9), device_get_next_child_node(9), fwnode_get_named_child_node(9), device_get_named_child_node(9), fwnode_handle_get(9), fwnode_device_is_available(9), fwnode_get_child_node_count(9), fwnode_get_named_child_node_count(9), fwnode_get_phy_mode(9), device_get_phy_mode(9), fwnode_iomap(9), fwnode_irq_get(9), fwnode_irq_get_byname(9), fwnode_graph_get_next_endpoint(9), fwnode_graph_get_port_parent(9), fwnode_graph_get_remote_port_parent(9), fwnode_graph_get_remote_port(9), fwnode_graph_get_remote_endpoint(9), fwnode_graph_get_endpoint_by_id(9), fwnode_graph_get_endpoint_count(9), fwnode_graph_parse_endpoint(9), fwnode_connection_find_match(9), fwnode_connection_find_matches(9)

like, every single one. no skips. we ate and left no crumbs πŸ“


and that's the page!! mwah πŸ’œ this one's from ./drivers/base, dated October 2026, and it's fwnode_get_next_child_node(9) all day long β€” go forth and put your handles, icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from