of_parse_phandle(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

of_parse_phandle β€” bestie, this is the one that resolves a phandle property into an actual device_node pointer πŸ’… (yes, we're in the of_parse_phandle(9) girlies, welcome to the Kernel API Manual, grab a seat πŸŽ€)


πŸ¦‹ SYNOPSIS πŸ¦‹

struct device_node * of_parse_phandle (const struct device_node *np ,
const char *phandle_name , int index );

🌸 ARGUMENTS 🌸

  • np β€” a pointer to the device node that's holding the phandle property. like, the node you're snooping in 🫢
  • phandle_name β€” the name of the property that's holding a phandle value. that's the label you're looking for, okurrr πŸ’–
  • index β€” so when a property holds a whole table of phandles, this is the index into that table. pick your slot, bestie ✨

πŸ‘‘ RETURN πŸ‘‘

You get back a device_node pointer, and its refcount has been incremented. not me forgetting to release it 😭 β€” make sure you call of_node_put on it when you're done, periodt. no cap, that part is literally mandatory πŸ’€


🌈 SEE ALSO 🌈

Kernel file ./include/linux/of.h β€” and like, the whole friend group:


⭐ ok that's the whole page, you ate that ngl πŸ’… go forth and parse those phandles, main character 🧚

mwah πŸ’œ this lil page lives in ./include/linux and it's stamped October 2026 β€” so go check it out in the Kernel API Manual, ily, bye bestie πŸ“βœ¨

πŸ“¦ where this page comes from