of_property_read_u8_index(9)
π of_property_read_u8_index β like, a whole manual page, but make it make sense
okay so bestie, picture this: it's a Kernel API Manual page, section 9, and it's literally called of_property_read_u8_index. Say that five times fast. No? Same. Anyway β it's giving "find one tiny little u8 hiding inside a multi-value property" energy, and honestly? Iconic. Let me spill. π
β¨ NAME β¨
of_property_read_u8_index β find and read a u8 from a multi-value property. That's it. That's the whole gig. π¦
πΈ SYNOPSIS πΈ
int of_property_read_u8_index (const struct device_node *np , const char
*propname , u32 index , u8 *out_value );
look at that signature. she's beautiful. she's int. she takes four arguments. we stan a consistent API. π
π§ ARGUMENTS π§
npβ the device node you're reading the property value from. your source of truth, your main character. πpropnameβ the name of the property we're searching for. spelling counts, bestie, don't come for me. πindexβ whichu8in the list of values you want. like picking a song out of a playlist, but with bytes. π΅out_valueβ pointer to the return value. it only gets modified if there's no error, so don't go reading it on faith. π
π₯ DESCRIPTION π₯
So what does it actually do? Simple: it searches for a property in a device node and reads the *n*th 8-bit value out of it. Nth. As in the index you passed. Gross but fair.
the out_value girlies, listen up: out_value is modified only if a valid u8 value can be decoded. no valid value? no touchy. she stays untouched. π
β RETURN β
the vibes, in return-code form:
0on success β slay, flawless, no notes π-EINVALif the property does not exist β she's not here, ma'am π-ENODATAif the property does not have a value β exists but empty, the worst kind of person π-EOVERFLOWif the property data isn't large enough β not enough bytes to go around, tragic, honestly π«Ά
π SEE ALSO π
okay this list is long long, so buckle up, we're doing the whole friend group. the kernel file is ./drivers/of/property.c, and then:
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_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_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)
like I said. the whole group chat. iykyk. π§ββοΈ
ngl bestie, if you only remember one thing: out_value doesn't change unless the decode works. that's the whole safety vibe check. β¨
and that's the page!! brought to you by ./drivers/of, dated October 2026, and yes, of_property_read_u8_index(9) is the name, it's always been the name, we're literally obsessed with her. mwah. πππ¦ 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