of_property_match_string(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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:


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