device_prope...ad_u32_array(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… device_prope...ad_u32_array(9) β€” like, the device_property_read_u32_array page, bestie

okay so this is a page from the Kernel API Manual, section 9 β€” yes, the big-kid kernel developer section 🧚✨ pull up a chair, we're reading firmware properties together.


✨ NAME ✨

device_property_read_u32_array β€” grab a whole u32 array property off a device and hand it back to you, no cap πŸ’–


🌸 SYNOPSIS 🌸

int device_property_read_u32_array (const struct device *dev , const
       char *propname , u32 *val , size_t nval );

literally that's it. one function call and the array is yours, iykyk 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device you're pulling the property off of. like, whose firmware description are we snooping through, bestie πŸ‘€
  • propname β€” the name of the property. this is the string you're looking for πŸ”
  • val β€” this is where the values get stashed. or pass NULL here and instead it just tells you how many values there are β€” iconic dual-purpose behavior, periodt ✨
  • nval β€” the size of the val array. just how much room you're giving it πŸ“

πŸ’œ DESCRIPTION πŸ’œ

so the function reads an array of u32 properties with propname out of the device firmware description, and if it finds them it stores them into val. slay 🌈

ok important side note: it's recommended to call device_property_count_u32 instead of calling this function with val equals NULL and nval equals 0. like, that's the vibe-approved way to count, fr fr πŸ™ˆ

πŸ”₯ RETURN πŸ”₯

here's the vibe check on what you get back:

  • number of values β€” if val was NULL πŸ’«
  • 0 β€” if the property was found (that's success, we ate) πŸ‘‘
  • -EINVAL β€” if the arguments you gave are not valid 😭
  • -ENODATA β€” if the property doesn't have a value πŸ’€
  • -EPROTO β€” if the property is not an array of numbers 🌸
  • -EOVERFLOW β€” if the size of the property is not as expected πŸ¦‹
  • -ENXIO β€” if there's no suitable firmware interface present πŸ˜”

🌟 SEE ALSO 🌟

kernel file ./drivers/base/property.c, plus literally the entire friend group:

like, that's the whole group chat, go say hi πŸ’…


ok bye bestie, go read some firmware properties 🫢 this page came from ./drivers/base and it's dated October 2026, and the header said device_prope...ad_u32_array(9) in case you forgot already πŸ’–βœ¨

πŸ“¦ where this page comes from