of_property...string_array(9)
π of_property_read_string_array β Kernel API Manual (section 9) π
okay bestie, sit down, because today we're reading an array of strings out of a device tree property and honestly? it's giving "small function, big main character energy." β¨
πΈ NAME πΈ
of_property_read_string_array β reads you an array of strings out of a multiple-strings property. that's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
int of_property_read_string_array (const struct device_node *np ,
const char *propname ,
const char **out_strs ,
size_t sz );
like, four args, returns an int, no cap. π«Ά
π ARGUMENTS π
npβ thedevice_nodeyou're pulling the property value out of. this is the main character of the operation, everything starts here β¨propnameβ the name of the property we're going hunting for. the little search bar of the whole situation πout_strsβ your output array of string pointers. this is where the results get dropped off, and yes you're providing it, no it's not optional if you want the actual strings πszβ how many array elements you're asking to read. the number of slots you're willing to fill, basically. don't overspend bestie π
π DESCRIPTION π
so here's the tea: you go searching for a property inside a device tree node, and if it's there, you retrieve a list of terminated string values β and this is important β as a pointer to data, not a copy. π«Ά
no duplicating, no cloning, no "let me just make my own version of this," it's literally just pointing at the original data. iconic behavior, lowkey efficient, highkey something you need to remember so you don't go freeing stuff you don't own π
β RETURN β
if out_strs is NULL, you get back the number of strings in the property, returned to you like a little gift π
that's the only return case the page gives us, so that's the one we're telling you, periodt. π―
π₯ SEE ALSO π₯
go read these next, they're all in the kernel file ./include/linux/of.h and honestly the whole friend group is here:
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_u32_elems(9)of_property_count_u64_elems(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)
okay that's the whole page, you ate that π
β¨ this one lives in ./include/linux and it's dated October 2026, and the page name with the dots in it is of_property...string_array(9) β mwah, bye bestie, go read some device trees π§ππΈ
π¦ 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