device_prop...string_array(9)
π 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 passNULLif you just want the number of values π«Άnvalβ size of thevalarray, 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 calldevice_property_string_array_countinstead of calling this function withvalequalsNULLandnvalequals0. 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
valis non-NULLπ - number of values available on success if
valisNULLβ -EINVALif given arguments are not valid π-ENODATAif the property does not have a value π-EPROTOor-EILSEQif the property is not an array of strings π-EOVERFLOWif the size of the property is not as expected π«-ENXIOif no suitable firmware interface is present π§
πΈ SEE ALSO πΈ
the whole friend group fr fr β kernel file ./drivers/base/property.c plus:
device_property_present(9)fwnode_property_present(9)device_property_read_bool(9)fwnode_property_read_bool(9)device_property_read_u8_array(9)device_property_read_u16_array(9)device_property_read_u32_array(9)device_property_read_u64_array(9)device_property_read_string(9)device_property_match_string(9)fwnode_property_read_u8_array(9)fwnode_property_read_u16_array(9)fwnode_property_read_u32_array(9)fwnode_property_read_u64_array(9)fwnode_property_read_string_array(9)fwnode_property_read_string(9)fwnode_property_match_string(9)fwnode_property_match_property_string(9)fwnode_property_get_reference_args(9)fwnode_find_reference(9)fwnode_get_name(9)fwnode_get_name_prefix(9)fwnode_name_eq(9)fwnode_get_parent(9)fwnode_get_next_parent(9)fwnode_count_parents(9)fwnode_get_nth_parent(9)fwnode_get_next_child_node(9)fwnode_get_next_available_child_node(9)device_get_next_child_node(9)fwnode_get_named_child_node(9)device_get_named_child_node(9)fwnode_handle_get(9)fwnode_device_is_available(9)fwnode_get_child_node_count(9)fwnode_get_named_child_node_count(9)fwnode_get_phy_mode(9)device_get_phy_mode(9)fwnode_iomap(9)fwnode_irq_get(9)fwnode_irq_get_byname(9)fwnode_graph_get_next_endpoint(9)fwnode_graph_get_port_parent(9)fwnode_graph_get_remote_port_parent(9)fwnode_graph_get_remote_port(9)fwnode_graph_get_remote_endpoint(9)fwnode_graph_get_endpoint_by_id(9)fwnode_graph_get_endpoint_count(9)fwnode_graph_parse_endpoint(9)fwnode_connection_find_match(9)fwnode_connection_find_matches(9)
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
- 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