fdt_setprop_inplace(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fdt_setprop_inplace β€” the fdt_setprop_inplace(9) situation, explained

okay so bestie, this is a page straight out of the Kernel API Manual and it's genuinely one of my faves because it's so polite. It changes a property's value without ever touching its size β€” like swapping the photo in a frame you already hung, no new nails required πŸŽ€


✨ NAME ✨

fdt_setprop_inplace β€” change a property's value, but not its size


✨ SYNOPSIS ✨

int fdt_setprop_inplace (void *fdt , int nodeoffset , const char *name ,
const void *val , int len );

✨ ARGUMENTS ✨

  • fdt β€” pointer to the device tree blob πŸ¦‹
  • nodeoffset β€” offset of the node whose property you're changing
  • name β€” name of the property you're changing
  • val β€” pointer to data to replace the property value with
  • len β€” length of the property value

✨ DESCRIPTION ✨

So fdt_setprop_inplace replaces the value of a given property with the data in val, of length len. The catch β€” and it's the catch, no cap β€” is that this function cannot change the size of a property, so it only works if len is exactly equal to the current length of the property. Length mismatch? It's giving "not today." πŸ’€

The other iconic thing: this function alters only the bytes in the blob that contain the given property value. It will not alter or move any other part of the tree. No domino effects, no chain reaction, just a little local glow-up ✨ Since it's not shifting anything around, the offsets of everything else stay exactly where they were β€” main character energy, but make it considerate πŸ’…


✨ RETURN ✨

  • 0 β€” on success, slay πŸŽ‰
  • -FDT_ERR_NOSPACE β€” if len is not equal to the property's current length
  • -FDT_ERR_NOTFOUND β€” node does not have the named property
  • -FDT_ERR_BADOFFSET β€” nodeoffset did not point to FDT_BEGIN_NODE tag
  • -FDT_ERR_BADMAGIC, -FDT_ERR_BADVERSION, -FDT_ERR_BADSTATE, -FDT_ERR_BADSTRUCTURE, -FDT_ERR_TRUNCATED β€” standard meanings
fr fr, don't ignore those error codes, they're literally telling you what went wrong 😭

✨ SEE ALSO ✨

Kernel file ./scripts/dtc/libfdt/libfdt.h, plus the whole friend group πŸ’–


🫢 the cute sign-off 🫢

This lil masterpiece lives in ./scripts/dtc/libfdt, and it was dated October 2026 β€” mark your calendars bestie, because that's when the vibes were officially enshrined βœ¨πŸ’– Go forth and set your props in place, and remember: size stays the same, always. periodt πŸ’…πŸ‘‘

πŸ“¦ where this page comes from