of_property_match_string(9)
okay so bestie, welcome to of_property_match_string(9) from the Kernel API Manual π
this one is lowkey iconic: it finds a string in a list and hands you the index, no cap β¨
π NAME π
of_property_match_string β Find string in a list and return index π
β¨ SYNOPSIS β¨
int of_property_match_string (const struct device_node *np , const char
*propname , const char *string );
π ARGUMENTS π
npβ pointer to the node containing the string list property π¦propnameβ string list property name πΈstringβ pointer to the string to search for in the string list π
π¦ DESCRIPTION π¦
Search for an exact match of string in a device node property which is a string of lists. That's the whole vibe check: exact match, string list property, index result β¨
π₯ RETURN π₯
On success, you get the index of the first occurrence of the string π
But bestie, sometimes it's giving error codes π:
-EINVALβ the property does not exist-ENODATAβ the property does not have a value-EILSEQβ the string is not null-terminated within the length of the property data
π SEE ALSO π
Kernel file ./drivers/of/property.c and the whole squad:
of_property_read_bool(9)of_graph_is_present(9)of_property_count_elems_of_size(9)of_find_property_value_of_size(9)of_property_read_u8_index(9)of_property_read_u16_index(9)of_property_read_u32_index(9)of_property_read_u64_index(9)of_property_read_variable_u8_array(9)of_property_read_variable_u16_array(9)of_property_read_variable_u32_array(9)of_property_read_u64(9)of_property_read_variable_u64_array(9)of_property_read_string(9)of_property_read_string_helper(9)of_graph_parse_endpoint(9)of_graph_get_port_by_id(9)of_graph_get_next_port(9)of_graph_get_next_port_endpoint(9)of_graph_get_next_endpoint(9)of_graph_get_endpoint_by_regs(9)of_graph_get_remote_endpoint(9)of_graph_get_port_parent(9)of_graph_get_remote_port_parent(9)of_graph_get_remote_port(9)of_graph_get_endpoint_count(9)of_graph_get_port_count(9)of_graph_get_remote_node(9)parse_prop_cells(9)parse_suffix_prop_cells(9)struct supplier_bindings(9)of_link_property(9)
mwah π this page's source/version is ./drivers/of and its date is October 2026 β of_property_match_string(9) out π
π«Ά
π¦ 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