fwnode_handle_get(9)
πΈ fwnode_handle_get(9) β Kernel API Manual energy πΈ
okay bestie, so this one's from the Linux Kernel API manual and it is literally the glow-up page for fwnode_handle_get(9) β the "grab a ref, don't lose it" icon of ./drivers/base/property.c. it's giving very small function, very big responsibility π
β¨ NAME β¨
fwnode_handle_get</p> β obtain a reference to a device node. that's it, that's the whole vibe, no cap π
π¦ SYNOPSIS π¦
struct fwnode_handle * fwnode_handle_get (struct fwnode_handle *fwnode
);
she takes exactly one argument and hands you back a struct fwnode_handle *. clean, minimal, main character energy β¨
π ARGUMENTS π
fwnodeβ pointer to the device node you're trying to obtain the reference to. like, the actual node. the one you want. that one π«Ά
π DESCRIPTION π
so here's the tea, and it's important tea π₯ β the caller is responsible for calling fwnode_handle_put on the returned fwnode pointer.
read that again. i'll wait. β
you get the ref, you clean up the ref. it's not the kernel's job, it's not the garbage collector's job (there is no garbage collector bestie this is C), it's your job. so if you take it, you put it. periodt π
fr fr, forget the fwnode_handle_put and you've got a leak. no cap, it's giving "i'll deal with it later" and later never comes π
π RETURN π
the fwnode handle. that's the whole answer. she returns the fwnode handle, iconic behaviour, no notes π
π§ SEE ALSO π§
Kernel file ./drivers/base/property.c, plus this whole extended friend group of related calls β every single one of them, because we do not leave a bestie behind π
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_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_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)
and that's the page!! π sign-off time: this lil beauty lives in ./drivers/base, dated October 2026, and it's page fwnode_handle_get(9) of the Kernel API Manual. go forth, take your refs, and put them back β i'm obsessed with you for reading this far, bestie πππ¦
π¦ 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