of_property_...ble_u8_array(9)
π of_property_read_variable_u8_array β a whole vibe check for your device tree arrays β¨
Okay bestie, so we're deep in the Kernel API Manual today and the function we're stanning is of_property_read_variable_u8_array. It's giving "find and read an array of u8 from a property, with bounds on the minimum and maximum array size" and honestly? Iconic. π
It lives in ./drivers/of (the device tree corner of the kernel, iykyk) and we are going to get through this together, no cap. π¦
πΈ SYNOPSIS πΈ
Like, here's the whole signature, copy it exactly bestie:
int of_property_read_variable_u8_array (const struct device_node *np ,
const char *propname , u8 *out_values , size_t sz_min , size_t sz_max );
β¨ ARGUMENTS β¨
Every single one matters, so let's go through them one by one:
npβ the device node from which the property value is to be read. Like, this is the node you're snooping through. πpropnameβ name of the property to be searched. The thing you're looking for, periodt.out_valuesβ pointer to found values. This is where the good stuff lands. πsz_minβ minimum number of array elements to read. The floor, the bare minimum, the "you must have at least this many" energy.sz_maxβ maximum number of array elements to read, and okay this part is important: if zero there is no upper limit on the number of elements in the dts entry but onlysz_minwill be read. So zero = "no ceiling, but we're still only grabbingsz_minof them." Don't forget that. π
π¦ DESCRIPTION π¦
So what does it actually do? Search for a property in a device node and read 8-bit value(s) from it. Simple as that. π§
The dts entry of the array should be like this, exactly:
property = /bits/ 8 <0x50 0x60 0x70>;
And here's the safety girlboss detail: the out_values is modified only if a valid u8 value can be decoded. So no garbage data sneaking in. We love a careful king. π
π₯ RETURN π₯
What comes back? Depends on how it goes, bestie:
- The number of elements read on success. Slay. β
-EINVALif the property does not exist. It's just not there, babe. π-ENODATAif property does not have a value. Empty. Void. Nothing. π-EOVERFLOWif the property data is smaller thansz_minor longer thansz_max. Too little or too much β both are a no from this function. π«
π SEE ALSO π
Okay this list is long but we do not skip, we respect the lore. Here's everything cross-referenced, character for character:
Kernel file ./drivers/of/property.c and all these besties:
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_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).
π That's the whole page, bestie. Every flag, every error, every reference β all present and accounted for. Go read your device trees with confidence. πΈ
This lil manual page is brought to you by ./drivers/of, dated October 2026, and it's literally the of_property_...ble_u8_array(9) glow-up you didn't know you needed. Mwah. ππ
π¦ 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