device_prop...string_array(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… device_property_read_string_array β€” Kernel API Manual, bestie edition

okay so you're in the Kernel API Manual and you found device_property_read_string_array(9) β€” and honestly? she's giving "let me grab that string array off your device real quick." Let's get into it πŸŽ€


✨ NAME ✨

device_property_read_string_array β€” return a string array property of device 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

int device_property_read_string_array (const struct device *dev , const
char *propname , const char **val , size_t nval );

πŸ’– ARGUMENTS πŸ’–

  • dev β€” the device you wanna get the property of. her. the main character πŸ‘‘
  • propname β€” name of the property, iykyk 🏷️
  • val β€” the values get stored here. or pass NULL if you just want the number of values 🫢
  • nval β€” size of the val array, so like, how much room you're giving her πŸ’…

🌈 DESCRIPTION 🌈

So the function reads an array of string properties with propname from the device firmware description, and stores them into val if it finds them. literally that's it, slay ✨

it's recommended to call device_property_string_array_count instead of calling this function with val equals NULL and nval equals 0. no cap, that's the move πŸ’―

πŸ”₯ RETURN πŸ”₯

bestie here's the vibes breakdown of what you get back:

  • number of values read on success if val is non-NULL πŸ’–
  • number of values available on success if val is NULL ⭐
  • -EINVAL if given arguments are not valid πŸ™ˆ
  • -ENODATA if the property does not have a value 😭
  • -EPROTO or -EILSEQ if the property is not an array of strings πŸ’€
  • -EOVERFLOW if the size of the property is not as expected 🫠
  • -ENXIO if no suitable firmware interface is present 🧚

🌸 SEE ALSO 🌸

the whole friend group fr fr β€” kernel file ./drivers/base/property.c plus:


and that's the whole page, periodt πŸ’… huge shoutout to ./drivers/base for holding it down β€” page dated October 2026, so she's fresh πŸ“ bye bestie, go read some string arrays 🫢✨

πŸ“¦ where this page comes from