of_property_count_u8_elems(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… of_property_count_u8_elems(9) πŸ’…

okay so bestie, this one's a kernel API manual page (section 9, the kernel API section, iykyk) and it's literally just a lil baby function that counts u8 elements in a device tree property. tiny. adorable. does one job. we respect her for that πŸŽ€


✨ NAME ✨

of_property_count_u8_elems β€” count the number of u8 elements in a property. that's it. that's the whole gig πŸ’–


🌸 SYNOPSIS 🌸

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

like, you hand her a node and a property name and she tells you how many u8s are in there. no cap 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • np β€” the device node you wanna read the property value from. main character of the operation ngl πŸ‘‘
  • propname β€” the name of the property you're searching for. the little label you're gonna go hunt down πŸ”

⭐ DESCRIPTION ⭐

so what she does is: she searches for a property inside a device node, and then counts how many u8 elements are sitting in it. that's the vibe check. property found β†’ count the u8s β†’ done ✨

literally nothing else. she's not doing your taxes, she's counting bytes. respect πŸ’œ


πŸ”₯ RETURN πŸ”₯

  • the number of elements β€” on success, bestie, slay πŸ’…
  • -EINVAL β€” if the property does not exist, or if its length doesn't match a multiple of u8 😭 (yeah, that second one is a real condition, don't @ me)
  • -ENODATA β€” if the property exists but doesn't have a value πŸ™ˆ
not me getting -EINVAL because the length wasn't a multiple of u8... anyway. check your lengths, bestie. πŸ’€

🌈 SEE ALSO 🌈

where she lives: kernel file ./include/linux/of.h 🧚

and her whole friend group, fr fr:

like the u16/u32/u64 versions are literally her sisters, go say hi 🫢


that's the whole page bestie, go count some u8s πŸ’–βœ¨

sign-off time πŸŽ€ this one's filed under ./include/linux, dated October 2026, and it's of_property_count_u8_elems(9) β€” periodt. πŸ’…πŸŒŸ

πŸ“¦ where this page comes from