of_property_read_u64_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… of_property_read_u64_index(9)

okay so bestie, welcome to the Kernel API Manual, and today's main character is of_property_read_u64_index(9) β€” say that five times fast, i promise it's worth it 🫢


✨ NAME ✨

of_property_read_u64_index β€” find and read a u64 from a multi-value property. like, you go looking for it, and then you read it. iconic behavior honestly πŸŽ€


🌸 SYNOPSIS 🌸

int of_property_read_u64_index (const struct device_node *np , const
char *propname , u32 index , u64 *out_value );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • np β€” the device node you're reading the property value from. your starting point, your home base, your main character node πŸ’–
  • propname β€” name of the property to be searched. literally the thing you're looking for, bestie.
  • index β€” index of the u64 in the list of values. yes, it's a list, yes you gotta pick one πŸ”₯
  • out_value β€” pointer to return value, and it gets modified only if no error. no cap, it stays untouched if things go sideways πŸ™ˆ

⭐ DESCRIPTION ⭐

So what does it actually do? it searches for a property in a device node and reads the *n*th 64-bit value from it. that's the whole vibe. one property, one node, one 64-bit value, selected by index πŸ’œ

And the important little caveat, because details matter: the out_value is modified only if a valid u64 value can be decoded. no valid u64, no touchy. periodt. ✨


πŸ‘‘ RETURN πŸ‘‘

  • 0 on success β€” slay, it worked πŸŽ‰
  • -EINVAL if the property does not exist β€” girl, it's not there πŸ’€
  • -ENODATA if property does not have a value β€” it exists but it's giving absolutely nothing 😭
  • -EOVERFLOW if the property data isn't large enough β€” too small, didn't fit, awkward 🌸

🌈 SEE ALSO 🌈

Kernel file ./drivers/of/property.c β€” that's where the magic lives, go look, iykyk πŸ’…


ok that's the whole page, bestie β€” go read some u64s responsibly, and remember: out_value only changes when there's a valid value to decode. no error, no write. we respect the pointer in this house 🫢

and that's a wrap!! brought to you by ./drivers/of, dated October 2026, filed lovingly under of_property_read_u64_index(9) β€” mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from