fwnode_get_nth_parent(9)
β¨ fwnode_get_nth_parent β¨
okay so real talk, this one lives in the Kernel API Manual, section 9, and it's lowkey one of the most useful little functions in the whole firmware-node friend group π
πΈ NAME πΈ
fwnode_get_nth_parent β bestie, it literally returns an nth parent of a node. that's it. that's the function. π
π¦ SYNOPSIS π¦
struct fwnode_handle * fwnode_get_nth_parent (struct fwnode_handle
*fwnode , unsigned int depth );
π ARGUMENTS π
fwnodeβ the node whose parent you're asking about π like, the main character heredepthβ the distance of the parent from the node. so how many steps up the family tree you're climbing π§
π DESCRIPTION π
okay so this is the part where i have to be responsible for a sec π β the caller is responsible for calling fwnode_handle_put on the returned fwnode pointer. no cap, that's on you. don't be the person who forgets. it's giving leak energy and we are NOT about that π
β RETURN β
it hands you back the nth parent of a node, periodt. β¨
- if there's no parent at the requested depth, you get
NULLback. sad but fair π - if
depthis0, the functionality is equivalent tofwnode_handle_getπ«Ά - for
depth == 1, it'sfwnode_get_parentand so on. the way it just scales, iconic honestly π
π SEE ALSO π
the kernel file ./drivers/base/property.c and honestly the whole extended fam β go say hi π:
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_next_child_node(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)
ngl bestie, if you got all the way down here you're genuinely built different π«Ά now go call fwnode_handle_put, i'm begging π
and that's the whole page!! this one comes from ./drivers/base, dated October 2026, and yes it's fwnode_get_nth_parent(9) β mwah, slay, bye πβ¨π
π¦ 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