of_property...lems_of_size(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

ok so this is of_property_count_elems_of_size β€” the Kernel API Manual girlies know her, she literally counts the number of elements in a property. that's it. that's her whole thing. πŸŽ€


✨ SYNOPSIS ✨

int of_property_count_elems_of_size (const struct device_node *np ,
const char *propname , int elem_size );

🌸 ARGUMENTS 🌸

  • np β€” the device node you're pulling the property value out of, bestie. like, which node are we reading from, yk?
  • propname β€” the name of the property we're searching for. the lil label we're hunting down πŸ”
  • elem_size β€” the size of one single individual element. one, singular, iconic. πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what she does 🫢 β€” she searches for a property in a device node, and then counts the number of elements of size elem_size inside it. genuinely that simple. no cap. she's not doing anything wild, she's just counting for you so you don't have to. main character energy fr. ✨


⭐ RETURN ⭐

  • the number of elements on success β€” slay, she ate πŸ‘‘
  • -EINVAL if the property does not exist or its length does not match a multiple of elem_size 😭 (yeah, both of those get the same treatment, sorry babe)
  • -ENODATA if the property does not have a value πŸ’€
ngl, remember that "multiple of elem_size" thing β€” if the length doesn't divide all cleanly by elem_size, it's an -EINVAL situation and you're getting nothing back. vibe check failed. πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./drivers/of/property.c, plus the whole entire friend group πŸ’–:


ok bye bestie, go count some elements πŸ’œ this one lives in ./drivers/of, October 2026, Kernel API Manual edition β€” mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from