STRUCT TARGET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 lil bool that tells you whether np is, 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, np is 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->np points 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:


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