add_changeset_node(9)
π 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β wherenodewill be placed in the live tree or changesetnodeβ 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 π¦
struct target(9)struct fragment(9)struct overlay_changeset(9)of_overlay_notifier_register(9)of_overlay_notifier_unregister(9)add_changeset_property(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)
π«Ά source/version:./drivers/ofΒ· date:October 2026β thatβs the footer, bestie, mwah π
π¦ 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