parse_prop_cells(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… parse_prop_cells β€” like, the property parsing function for suppliers, bestie

okay so real talk: this one lives in the Kernel API Manual (section 9), and it's genuinely shorter than most of the pages in this family, so we can absolutely get through it together. grab a boba, we're parsing device tree properties. πŸ§‹βœ¨


🌸 NAME 🌸

parse_prop_cells β€” Property parsing function for suppliers

like yes that's the whole name section, it's giving minimalism, we love that for it πŸ’…


✨ SYNOPSIS ✨

struct device_node * parse_prop_cells (struct device_node *np , const
char *prop_name , int index , const char *list_name , const char
*cells_name );

she returns a struct device_node * and takes five args, no cap. every single one spelled exactly like that, don't come for me 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • np β€” Pointer to device tree node containing a list. this is the node you're digging around in, your starting point, your main character πŸ¦‹
  • prop_name β€” Name of property to be parsed. Expected to hold phandle values. so it's the property you're actually reading, and the vibes are: phandles 🏷️
  • index β€” For properties holding a list of phandles, this is the index into the list. like, which one do you want. zero-based energy, you know the drill πŸ”’
  • list_name β€” Property name that is known to contain list of phandle(s) to supplier(s). the supplier list property, aka where all the phandles hang out πŸ’œ
  • cells_name β€” property name that specifies phandles' arguments count. it's the thing that tells you how many arguments each phandle is carrying around with it 😭

πŸ”₯ DESCRIPTION πŸ”₯

so the whole point: this is a helper function to parse properties that have a known fixed name and are a list of phandles and phandle arguments.

that's it. that's the description. she's a helper, she's focused, she knows what she's about. honestly iconic, no notes 🌈


⭐ RETURN ⭐

here's what you actually get back, and this part is important so like, pay attention bestie πŸ‘€

  • phandle node pointer with refcount incremented. Caller must of_node_put on it when done.
  • NULL if no phandle found at index
⚠️ serious business for one sec: that refcount is incremented. you must call of_node_put on the returned node when you're done with it. that's not optional, that's not a suggestion, that's how you avoid leaking a reference. don't leave her hanging πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/of/property.c and honestly the whole friend group:

like, that's the entire of_graph squad plus the property helpers. read them, love them, they're all on the same page (metaphorically) πŸ«ΆπŸ’–


and that's the whole page, bestie!! πŸŽ€ sign-off time: this one comes from ./drivers/of, dated October 2026, and it's filed under parse_prop_cells(9) in the Kernel API Manual. slay, go put your nodes back. πŸ’œβœ¨

πŸ“¦ where this page comes from