of_property...lems_of_size(9)
π NAME π
ok so this is of_property_count_elems_of_size β the Kernel API Manual girlies know her, she literally counts the number of elements in a property. that's it. that's her whole thing. π
β¨ SYNOPSIS β¨
int of_property_count_elems_of_size (const struct device_node *np ,
const char *propname , int elem_size );
πΈ ARGUMENTS πΈ
npβ the device node you're pulling the property value out of, bestie. like, which node are we reading from, yk?propnameβ the name of the property we're searching for. the lil label we're hunting down πelem_sizeβ the size of one single individual element. one, singular, iconic. π
π¦ DESCRIPTION π¦
okay so what she does π«Ά β she searches for a property in a device node, and then counts the number of elements of size elem_size inside it. genuinely that simple. no cap. she's not doing anything wild, she's just counting for you so you don't have to. main character energy fr. β¨
β RETURN β
- the number of elements on success β slay, she ate π
-EINVALif the property does not exist or its length does not match a multiple ofelem_sizeπ (yeah, both of those get the same treatment, sorry babe)-ENODATAif the property does not have a value π
ngl, remember that "multiple ofelem_size" thing β if the length doesn't divide all cleanly byelem_size, it's an-EINVALsituation and you're getting nothing back. vibe check failed. π
π SEE ALSO π
Kernel file ./drivers/of/property.c, plus the whole entire friend group π:
of_property_read_bool(9)of_graph_is_present(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_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)
ok bye bestie, go count some elements π this one lives in ./drivers/of, October 2026, Kernel API Manual edition β 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