of_property_read_u64(9)
π of_property_read_u64(9) β the kernel API manual, but make it make sense
okay so bestie, this is of_property_read_u64(9), and yes the name is a mouthful but it's literally just "go find a property and read a 64-bit number out of it". we're in the kernel API manual, this is device-tree territory, and it's giving very demure, very mindful, very drivers/of. let's go π
β¨ NAME β¨
of_property_read_u64 β find a property and read a 64 bit integer out of it. that's it. that's the whole vibe. π
πΈ SYNOPSIS πΈ
int of_property_read_u64 (const struct device_node *np , const char
*propname , u64 *out_value );
like, three args, one int coming back at you, no drama. π¦
π«Ά ARGUMENTS π«Ά
npβ the device node you're reading the property value from. this is your main character. πpropnameβ the name of the property you're searching for. iykyk, you gotta know what you're looking for. πout_valueβ a pointer to the return value. and listen β it only gets modified if the return value is0. so if you're out here assuming it got written, no bestie, check that return first. π
π§ DESCRIPTION π§
so the whole thing is: search for a property inside a device node, then read a 64-bit value out of it. lowkey simple, highkey useful. β¨
the out_value is modified only if a valid u64 value can actually be decoded. no valid decode = no touchy. hands off. π
π₯ RETURN π₯
0on success β slay, you got your value π-EINVALif the property does not exist β it's not there, bestie, it's just not π-ENODATAif the property does not have a value β the property is there but it's giving nothing. empty. void. π³οΈ-EOVERFLOWif the property data isn't large enough β too small to hold au64, we can't work with that π«
fr fr, check your return code. the out_value write is conditional and that is not a drill. β οΈ
π SEE ALSO π
the kernel file lives at ./drivers/of/property.c, and here's the whole friend group π«:
of_property_read_bool(9)of_graph_is_present(9)of_property_count_elems_of_size(9)of_find_property_value_of_size(9)of_property_read_u8_index(9)of_property_read_u16_index(9)of_property_read_u32_index(9)of_property_read_u64_index(9)of_property_read_variable_u8_array(9)of_property_read_variable_u16_array(9)of_property_read_variable_u32_array(9)of_property_read_variable_u64_array(9)of_property_read_string(9)of_property_match_string(9)of_property_read_string_helper(9)of_graph_parse_endpoint(9)of_graph_get_port_by_id(9)of_graph_get_next_port(9)of_graph_get_next_port_endpoint(9)of_graph_get_next_endpoint(9)of_graph_get_endpoint_by_regs(9)of_graph_get_remote_endpoint(9)of_graph_get_port_parent(9)of_graph_get_remote_port_parent(9)of_graph_get_remote_port(9)of_graph_get_endpoint_count(9)of_graph_get_port_count(9)of_graph_get_remote_node(9)parse_prop_cells(9)parse_suffix_prop_cells(9)struct supplier_bindings(9)of_link_property(9)
and that's the whole page, bestie π this one's from ./drivers/of, dated October 2026, and it goes by of_property_read_u64(9) β periodt. πβ¨
π¦ 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