of_property_read_u16_index(9)
πΈ NAME πΈ
of_property_read_u16_index β find and read a u16 from a multi-value property. π
okay bestie, welcome to the of_property_read_u16_index(9) page! this is the Kernel API Manual corner of the group chat, section 9 and all β stay hydrated, we're reading device-tree properties today π«Ά
β¨ SYNOPSIS β¨
the signature, untouched and iconic:
int of_property_read_u16_index (const struct device_node *np , const
char *propname , u32 index , u16 *out_value );
π ARGUMENTS π
okay so here's who's who in this function's little friend group:
npβ the device node from which the property value is to be read. think of it as the tree we're snooping in π³propnameβ name of the property to be searched. the property name we're looking for, iykyk πindexβ index of theu16in the list of values. which 16-bit value you want from the list, bestie π―out_valueβ pointer to return value, modified only if no error. it's where the value goes, and it does not get touched if there's an error π
π¦ DESCRIPTION π¦
search for a property in a device node and read the nth 16-bit value from it. literally that's the whole mission β¨
the out_value is modified only if a valid u16 value can be decoded. no valid decode? no touch. periodt. π
π« RETURN π«
vibe check on what comes back:
0β success, we ate β-EINVALβ the property does not exist π-ENODATAβ the property does not have a value π«-EOVERFLOWβ the property data isn't large enough π
π SEE ALSO π
Kernel file: ./drivers/of/property.c β and the whole friend group is:
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_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_u64(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)
mwah π β this page's source/version is ./drivers/of, dated October 2026. now go read that 16-bit value and slay, 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