of_property_count_u32_elems(9)
π¦ of_property_count_u32_elems(9) β the Kernel API Manual page, bestie edition β¨
okay so you're in the Kernel API Manual and the star of the show today is of_property_count_u32_elems(9) π
she's a little function with one job and she does it immaculately.
πΈ NAME πΈ
of_property_count_u32_elems β literally just counts how many u32 elements are chilling inside a property. that's it. that's the whole gig. no cap π
β¨ SYNOPSIS β¨
int of_property_count_u32_elems (const struct device_node *np , const
char *propname );
like look at her. returns an int, takes a const struct device_node *np and a const char *propname. iconic signature, no notes π«Ά
π ARGUMENTS π
npβ the device node you're reading the property value from. this is your main character β everything happens inside her πpropnameβ the name of the property you're out here searching for. yes bestie, you gotta know her name π
π₯ DESCRIPTION π₯
so what she does is: search for a property in a device node, and count the number of u32 elements in it. that's the vibe check, that's the whole task, and she ate πβ¨
no guessing, no extra lore β find the property, count the u32s inside it, done. periodt π§
π RETURN π
here's what she hands back to you:
- the number of elements on success β slay π
-EINVALif the property does not exist or if its length does not match a multiple ofu32π (yeah, that second one is a real heartbreak, watch your byte counts)-ENODATAif the property does not have a value π
fr fr check your return value, like don't just assume she worked, the errors are real and they will humble you π
π SEE ALSO π
goes without saying but imma say it anyway β she lives in the kernel file ./include/linux/of.h π and these are her besties:
of_node_init(9)of_machine_is_compatible(9)of_parse_phandle(9)of_parse_phandle_with_args(9)of_parse_phandle_with_fixed_args(9)of_parse_phandle_with_optional_args(9)of_phandle_args_equal(9)of_property_count_u8_elems(9)of_property_count_u16_elems(9)of_property_count_u64_elems(9)of_property_read_string_array(9)of_property_count_strings(9)of_property_read_string_index(9)of_property_present(9)of_property_read_u8_array(9)of_property_read_u16_array(9)of_property_read_u32_array(9)of_property_read_u64_array(9)struct of_changeset_entry(9)struct of_changeset(9)of_device_is_system_power_controller(9)of_have_populated_dt(9)
iykyk, that's a whole friend group and they're all lowkey serving π
and that's the page!! π¦π source dir is ./include/linux and the date on this one is October 2026, and the page herself is of_property_count_u32_elems(9) β mwah, go count some elements bestie, you're gonna do amazing πβ¨π
π¦ 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