of_parse_phandle(9)
β¨ 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:
of_node_init(9)of_machine_is_compatible(9)of_parse_phandle_with_args(9)of_parse_phandle_with_fixed_args(9)of_parse_phandle_with_optional_args(9)of_phandle_args_equal(9)of_property_count_u8_elems(9)of_property_count_u16_elems(9)of_property_count_u32_elems(9)of_property_count_u64_elems(9)of_property_read_string_array(9)of_property_count_strings(9)of_property_read_string_index(9)of_property_present(9)of_property_read_u8_array(9)of_property_read_u16_array(9)of_property_read_u32_array(9)of_property_read_u64_array(9)struct of_changeset_entry(9)struct of_changeset(9)of_device_is_system_power_controller(9)of_have_populated_dt(9)
β 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms