add_changeset_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… add_changeset_node(9) β€” your Kernel API Manual bestie check ✨

🌸 NAME 🌸

add_changeset_node β€” add @node (and children) to overlay changeset πŸ’«

✨ SYNOPSIS ✨

int add_changeset_node (struct overlay_changeset *ovcs , struct target
       *target , const struct device_node *node );

πŸŽ€ ARGUMENTS πŸŽ€

  • ovcs β€” the overlay changeset, aka the main character of this whole situation 🫢
  • target β€” where node will be placed in the live tree or changeset
  • node β€” node from within the overlay device tree fragment 🌸

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, here’s the vibe: if node does not already exist in target, add_changeset_node adds a changeset entry to add node in target. slay ✨

If node already exists in target, and the existing node has a phandle, then the overlay node is not allowed to have a phandle. that’s a hard rule, no cap πŸ’…

If node has child nodes, it adds the children recursively via build_changeset_next_level. cute little recursion moment πŸŽ€

πŸ’€ NOTE_1 πŸ’€

A live devicetree created from a flattened device tree (FDT) will not contain the full path in node->full_name. Thus an overlay created from an FDT also will not contain the full path in node->full_name. However, a live devicetree created from Open Firmware may have the full path in node->full_name. πŸ‘€

add_changeset_node follows the FDT convention and does not include the full path in node->full_name. Even though it expects the overlay to not contain the full path, it uses kbasename to remove the full path should it exist. It also uses kbasename in comparisons to nodes in the live devicetree so that it can apply an overlay to a live devicetree created from Open Firmware. iconic behavior, honestly 🌈

πŸ”₯ NOTE_2 πŸ”₯

Multiple mods of created nodes not supported. periodt πŸ’€

🌟 RETURN 🌟

  • 0 β€” success, we love to see it πŸ’–
  • -ENOMEM β€” memory allocation failure 😭
  • -EINVAL β€” invalid overlay πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/of/overlay.c β€” the source vibes live here πŸ¦‹

🫢 source/version: ./drivers/of Β· date: October 2026 β€” that’s the footer, bestie, mwah πŸ’–
πŸ“¦ where this page comes from