of_property_read_u64(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… of_property_read_u64(9) β€” the kernel API manual, but make it make sense

okay so bestie, this is of_property_read_u64(9), and yes the name is a mouthful but it's literally just "go find a property and read a 64-bit number out of it". we're in the kernel API manual, this is device-tree territory, and it's giving very demure, very mindful, very drivers/of. let's go πŸŽ€


✨ NAME ✨

of_property_read_u64 β€” find a property and read a 64 bit integer out of it. that's it. that's the whole vibe. πŸ’–


🌸 SYNOPSIS 🌸

int of_property_read_u64 (const struct device_node *np , const char
*propname , u64 *out_value );

like, three args, one int coming back at you, no drama. πŸ¦‹


🫢 ARGUMENTS 🫢

  • np β€” the device node you're reading the property value from. this is your main character. πŸ‘‘
  • propname β€” the name of the property you're searching for. iykyk, you gotta know what you're looking for. πŸ”
  • out_value β€” a pointer to the return value. and listen β€” it only gets modified if the return value is 0. so if you're out here assuming it got written, no bestie, check that return first. πŸ’€

🧚 DESCRIPTION 🧚

so the whole thing is: search for a property inside a device node, then read a 64-bit value out of it. lowkey simple, highkey useful. ✨

the out_value is modified only if a valid u64 value can actually be decoded. no valid decode = no touchy. hands off. πŸ™ˆ


πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” slay, you got your value πŸ’…
  • -EINVAL if the property does not exist β€” it's not there, bestie, it's just not 😭
  • -ENODATA if the property does not have a value β€” the property is there but it's giving nothing. empty. void. πŸ•³οΈ
  • -EOVERFLOW if the property data isn't large enough β€” too small to hold a u64, we can't work with that 🫠
fr fr, check your return code. the out_value write is conditional and that is not a drill. ⚠️

🌈 SEE ALSO 🌈

the kernel file lives at ./drivers/of/property.c, and here's the whole friend group πŸ«‚:


and that's the whole page, bestie πŸŽ€ this one's from ./drivers/of, dated October 2026, and it goes by of_property_read_u64(9) β€” periodt. πŸ’œβœ¨

πŸ“¦ where this page comes from