device_prope...match_string(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… device_property_match_string(9) β€” the Kernel API Manual, bestie edition

okay so picture this: you're deep in the Kernel API Manual, right, and you just need to know if a string is chilling in a property array, and where. That's it. That's the whole gig. And honestly? She ate. ✨


🌸 NAME 🌸

device_property_match_string β€” find a string in an array and return the index, periodt.


✨ SYNOPSIS ✨

int device_property_match_string (const struct device *dev , const char *propname , const char *string );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device you're pulling the property off of. like, whose vibe are we checking πŸ’–
  • propname β€” the name of the property that's holding the array. this is the shelf we're looking on.
  • string β€” the actual string we're hunting for. the main character we're tryna find πŸ”

πŸ¦‹ DESCRIPTION πŸ¦‹

so the move is: find a given string in a string array, and if it's found, return the index back. that's literally it. no cap, no extra steps. you hand her a string, she tells you which slot it's living in 🫢


πŸ‘‘ RETURN πŸ‘‘

  • index, starting from 0, if the property was found (success) β€” slay, she's there πŸ’…
  • -EINVAL if given arguments are not valid β€” like, the inputs are giving nothing πŸ™ˆ
  • -ENODATA if the property does not have a value β€” empty shelf energy 😭
  • -EPROTO if the property is not an array of strings β€” wrong genre of array entirely, not her πŸ’€
  • -ENXIO if no suitable firmware interface is present β€” no firmware, no service, we can't even start 🌸
bestie pls actually check the return value. a negative number is not an index, it's a mood, and you need to handle it. πŸ”₯

🌈 SEE ALSO 🌈

Kernel file ./drivers/base/property.c β€” and the whole extended fam, iykyk:


and that's the whole page, bestie πŸ§šπŸ’œ straight from ./drivers/base, dated October 2026, and yeah the title up top still reads device_prope...match_string(9) like it got cut off mid-sentence β€” iconic honestly. mwah πŸ’‹β­

πŸ“¦ where this page comes from