STRUCT TARGET(9)
β¨ struct target(9) β¨
okay so bestie, this is the tea on struct target β it's literally the info about the current target node as you're recursing through an overlay. kernel API manual vibes, devicetree era, we love to see it π
π SYNOPSIS π
struct target {
struct device_node *np;
bool in_livetree;
};
no cap, that's the whole thing. two members, both iconic, both doing their job π«Ά
πΈ Members πΈ
npβ this is the node where the current level of the overlay is gonna be applied. that's the whole assignment, that's the mission πin_livetreeβ a lilboolthat tells you whethernpis, in fact, a node in the live devicetree. simple. honest. slay β¨
π¦ Description π¦
so like, this struct is used in the algorithm that creates the portion of a changeset describing an overlay fragment β and an overlay fragment is a devicetree subtree, periodt.
here's the storyline, bestie π¬:
- Initially,
npis a node in the live devicetree where the overlay subtree is targeted to be grafted into. that's the starting point, the main character energy π - When you recurse to the next level of the overlay subtree, the target also recurses to the next level of the live devicetree β but only as long as the overlay subtree node also exists in the live devicetree. conditional queen behavior tbh π
- When a node in the overlay subtree does NOT exist at the same level in the live devicetree, then
target->nppoints to a newly allocated node, and all subsequent targets in the subtree will be newly allocated nodes. so it's fresh nodes from there on out, like a whole new era π¦
not me explaining devicetree overlay recursion like it's a group chat drama... but also if you get it you get it, iykyk ππ
π SEE ALSO π
kernel file ./drivers/of/overlay.c β go read it fr fr, and while you're there check out these besties:
struct fragment(9)struct overlay_changeset(9)of_overlay_notifier_register(9)of_overlay_notifier_unregister(9)add_changeset_property(9)add_changeset_node(9)build_changeset_next_level(9)changeset_dup_entry_check(9)build_changeset(9)init_overlay_changeset(9)of_overlay_fdt_apply(9)of_overlay_remove(9)of_overlay_remove_all(9)
and that's the page, bestie π this one lives in ./drivers/of, dated October 2026, and it's struct target(9) β go forth and recurse responsibly πβ¨π«Ά
π¦ 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