of_property...le_u32_array(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ of_property_read_variable_u32_array β€” Kernel API Manual, section 9

okay bestie, so you're in the Kernel API Manual (section 9, very demure, very kernel) and you've stumbled onto of_property_read_variable_u32_array. Don't panic. She's actually iconic once you get to know her. ✨


🌸 NAME

of_property_read_variable_u32_array β€” find and read an array of 32 bit integers from a property, with bounds on the minimum and maximum array size. literally she reads your numbers and checks they're within the vibe check limits πŸŽ€


πŸ¦‹ SYNOPSIS

int of_property_read_variable_u32_array (const struct device_node *np ,
const char *propname , u32 *out_values , size_t sz_min , size_t sz_max
);

look at her. four params, one return int, zero notes. she's booked and busy. πŸ’…


🎯 ARGUMENTS

  • np β€” the device node from which the property value is to be read. your main character node, the source of truth 🫢
  • propname β€” name of the property to be searched. yes bestie, you gotta name it, she's not a mind reader πŸ’€
  • out_values β€” pointer to return found values. this is where the slay lands ✨
  • sz_min β€” minimum number of array elements to read. the floor, the bare minimum, the no-less-than πŸ’–
  • sz_max β€” maximum number of array elements to read. and listen: if zero there is no upper limit on the number of elements in the dts entry but only sz_min will be read. that's a whole mood, so don't come crying when you only get sz_min back 😭

πŸ”₯ DESCRIPTION

Search for a property in a device node and read 32-bit value(s) from it. that's it, that's the job. she finds it, she reads it, she moves on. no cap. ⭐

The out_values is modified only if a valid u32 value can be decoded. so if the decoding flops, your buffer stays untouched β€” no half-written chaos, no leftovers, we love a careful queen πŸ™ˆ


πŸ‘‘ RETURN

The number of elements read on success. and when she's not happy:

  • -EINVAL β€” if the property does not exist. ghosted πŸ’€
  • -ENODATA β€” if property does not have a value. present but empty, the worst kind of energy 😭
  • -EOVERFLOW β€” if the property data is smaller than sz_min or longer than sz_max. too little, or too much, both unaccepted bestie πŸ’…

🌈 SEE ALSO

Kernel file ./drivers/of/property.c β€” go read the source, iykyk 🧚

that's a whole friend group right there, and they all ate πŸ“


reminder bestie: sz_max being 0 does not mean "read everything" β€” it means no upper limit exists on the dts entry, but only sz_min gets read. read it twice. tattoo it. πŸŽ€

that's the whole page, no notes πŸ’– this came out of ./drivers/of, dated October 2026, in the Kernel API Manual β€” mwah, go read your device trees, ily, periodt. πŸ‘‘βœ¨

πŸ“¦ where this page comes from