of_property_read_u16_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

of_property_read_u16_index β€” find and read a u16 from a multi-value property. πŸ’–

okay bestie, welcome to the of_property_read_u16_index(9) page! this is the Kernel API Manual corner of the group chat, section 9 and all β€” stay hydrated, we're reading device-tree properties today 🫢

✨ SYNOPSIS ✨

the signature, untouched and iconic:

int of_property_read_u16_index (const struct device_node *np , const
char *propname , u32 index , u16 *out_value );

πŸŽ€ ARGUMENTS πŸŽ€

okay so here's who's who in this function's little friend group:

  • np β€” the device node from which the property value is to be read. think of it as the tree we're snooping in 🌳
  • propname β€” name of the property to be searched. the property name we're looking for, iykyk πŸ”Ž
  • index β€” index of the u16 in the list of values. which 16-bit value you want from the list, bestie 🎯
  • out_value β€” pointer to return value, modified only if no error. it's where the value goes, and it does not get touched if there's an error πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

search for a property in a device node and read the nth 16-bit value from it. literally that's the whole mission ✨

the out_value is modified only if a valid u16 value can be decoded. no valid decode? no touch. periodt. πŸ’–

πŸ’« RETURN πŸ’«

vibe check on what comes back:

  • 0 β€” success, we ate βœ…
  • -EINVAL β€” the property does not exist πŸ’€
  • -ENODATA β€” the property does not have a value 🫠
  • -EOVERFLOW β€” the property data isn't large enough 😭

🌈 SEE ALSO 🌈

Kernel file: ./drivers/of/property.c β€” and the whole friend group is:


mwah πŸ’‹ β€” this page's source/version is ./drivers/of, dated October 2026. now go read that 16-bit value and slay, bestie 🫢✨

πŸ“¦ where this page comes from