of_property_read_u8_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… of_property_read_u8_index β€” like, a whole manual page, but make it make sense

okay so bestie, picture this: it's a Kernel API Manual page, section 9, and it's literally called of_property_read_u8_index. Say that five times fast. No? Same. Anyway β€” it's giving "find one tiny little u8 hiding inside a multi-value property" energy, and honestly? Iconic. Let me spill. πŸŽ€


✨ NAME ✨

of_property_read_u8_index β€” find and read a u8 from a multi-value property. That's it. That's the whole gig. πŸ¦‹


🌸 SYNOPSIS 🌸

int of_property_read_u8_index (const struct device_node *np , const char
*propname , u32 index , u8 *out_value );

look at that signature. she's beautiful. she's int. she takes four arguments. we stan a consistent API. πŸ’œ


🧚 ARGUMENTS 🧚

  • np β€” the device node you're reading the property value from. your source of truth, your main character. πŸ‘‘
  • propname β€” the name of the property we're searching for. spelling counts, bestie, don't come for me. πŸ”
  • index β€” which u8 in the list of values you want. like picking a song out of a playlist, but with bytes. 🎡
  • out_value β€” pointer to the return value. it only gets modified if there's no error, so don't go reading it on faith. πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

So what does it actually do? Simple: it searches for a property in a device node and reads the *n*th 8-bit value out of it. Nth. As in the index you passed. Gross but fair.

the out_value girlies, listen up: out_value is modified only if a valid u8 value can be decoded. no valid value? no touchy. she stays untouched. πŸ’…

⭐ RETURN ⭐

the vibes, in return-code form:

  • 0 on success β€” slay, flawless, no notes πŸ’–
  • -EINVAL if the property does not exist β€” she's not here, ma'am 😭
  • -ENODATA if the property does not have a value β€” exists but empty, the worst kind of person πŸ’€
  • -EOVERFLOW if the property data isn't large enough β€” not enough bytes to go around, tragic, honestly 🫢

🌈 SEE ALSO 🌈

okay this list is long long, so buckle up, we're doing the whole friend group. the kernel file is ./drivers/of/property.c, and then:

like I said. the whole group chat. iykyk. πŸ§šβ€β™€οΈ


ngl bestie, if you only remember one thing: out_value doesn't change unless the decode works. that's the whole safety vibe check. ✨

and that's the page!! brought to you by ./drivers/of, dated October 2026, and yes, of_property_read_u8_index(9) is the name, it's always been the name, we're literally obsessed with her. mwah. πŸ’‹πŸŽ€πŸ¦‹ periodt.

πŸ“¦ where this page comes from