of_resolve_phandles(9)
π of_resolve_phandles(9) π
okay so bestie, welcome to the Kernel API Manual entry for of_resolve_phandles β this is the one that takes your devicetree overlay and makes it play nice with the live tree. no cap, it's lowkey iconic. π¦
β¨ NAME β¨
of_resolve_phandles β relocate and resolve an overlay against the live tree π
πΈ SYNOPSIS πΈ
int of_resolve_phandles(struct device_node *overlay);
π§ ARGUMENTS π§
overlayβ pointer to the devicetree overlay we're gonna relocate and resolve, bestie. that's the whole vibe. π
π₯ DESCRIPTION π₯
So what's actually happening here? Two things, and they're both giving main character energy:
First, we modify (relocate) the values of local phandles in the overlay to a range that does not conflict with the live expanded devicetree. Then we update the references to those local phandles in the overlay. β¨
Second, we update (resolve) phandle references in the overlay that refer to the live expanded devicetree.
Here's the math, iykyk:
- phandle values in the live tree live in the range of
1 .. live_tree_max_phandleπ - phandle values in the overlay also begin at
1, which is exactly the problem π - so we adjust the phandle values in the overlay to begin at
live_tree_max_phandle + 1 - and then we update the references to the phandles so they point at the adjusted phandle values π«Ά
Now, the __fixups__ node. listen:
The name of each property in the __fixups__ node in the overlay matches the name of a symbol (a label) in the live tree. the way that works is so clean honestly. π
The value of each property in the __fixups__ node is a list of the property values in the overlay that need to be updated to contain the phandle reference corresponding to that symbol in the live tree. so we update those references in the overlay with the phandle values from the live tree. periodt. π
β οΈ overlay must be detached. like, actually. fr fr.
π Important caveat, don't skip this one: resolving and applying an overlay to the live expanded devicetree must be protected by a mechanism to ensure that multiple overlays are processed in a single threaded manner, so that multiple overlays will not relocate phandles to overlapping ranges. sounds great, right? yeah β the mechanism to enforce this is not yet implemented. π so keep that in mind, bestie.
β RETURN β
0 on success, or a negative error value on error. that's it, that's the whole return section. π
π SEE ALSO π
- kernel file
./drivers/of/resolver.cβ go read it, i believe in you π§
and that's the page!! sourced from ./drivers/of, dated October 2026 β mwah, go resolve some phandles, ily, bye!! ππ¦β¨π
π¦ 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