of_property...string_array(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” the device_node you'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:


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